Skip to content

Commit

Permalink
Ensure value becomes a string (see Viva-con-Agua/pool-backend#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebroda committed Dec 19, 2024
1 parent 66929e3 commit 595602c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vmdb/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (i *Pipeline) Skip(value int64, defaultValue int64) *Pipeline {
func (i *Pipeline) SortFields(sort bson.D) *Pipeline {
fields := bson.D{}
for _, entry := range sort {
lower := bson.E{Key: "lower" + entry.Key, Value: bson.D{{Key: "$toLower", Value: "$" + entry.Key}}}
lower := bson.E{Key: "lower" + entry.Key, Value: bson.D{{Key: "$toLower", Value: bson.D{{Key: "$toString", Value: "$" + entry.Key}}}}}
fields = append(fields, lower)
}
sortFields := bson.D{{Key: "$addFields", Value: fields}}
Expand Down

0 comments on commit 595602c

Please sign in to comment.