2023-06-06 21:18:40 +02:00
|
|
|
package cursortoken
|
|
|
|
|
|
|
|
type SortDirection string //@enum:type
|
|
|
|
|
|
|
|
const (
|
|
|
|
SortASC SortDirection = "ASC"
|
|
|
|
SortDESC SortDirection = "DESC"
|
|
|
|
)
|
2024-12-09 17:39:35 +01:00
|
|
|
|
|
|
|
func (sd SortDirection) ToMongo() int {
|
|
|
|
if sd == SortASC {
|
|
|
|
return 1
|
|
|
|
} else if sd == SortDESC {
|
|
|
|
return -1
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|