Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions worker/sai-storage-mongo/external/adapter/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ type Request struct {
}

type Options struct {
Limit int64 `json:"limit"`
Skip int64 `json:"skip"`
Sort interface{} `json:"sort"`
Count int64 `json:"count"`
Limit int64 `json:"limit"`
Skip int64 `json:"skip"`
Sort interface{} `json:"sort"`
Count int64 `json:"count"`
NumericOrdering bool `json:"numeric_ordering"`
}

func (r Request) GetMethod() string {
Expand Down
4 changes: 4 additions & 0 deletions worker/sai-storage-mongo/mongo/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ func (c Client) Find(collectionName string, selector map[string]interface{}, inp
requestOptions.SetProjection(projection)
}

if inputOptions.NumericOrdering {
requestOptions.Collation.NumericOrdering = true
}

collection := c.GetCollection(collectionName)
selector = c.preprocessSelector(selector)

Expand Down
9 changes: 5 additions & 4 deletions worker/sai-storage-mongo/types/mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ type FindResult struct {
}

type Options struct {
Limit int64 `json:"limit"`
Skip int64 `json:"skip"`
Sort interface{} `json:"sort"`
Count int64 `json:"count"`
Limit int64 `json:"limit"`
Skip int64 `json:"skip"`
Sort interface{} `json:"sort"`
Count int64 `json:"count"`
NumericOrdering bool `json:"numeric_ordering"`
}
Loading