-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.4.6
-
Component/s: API
-
None
I write a sample test on: https://github.com/GaoJianAllen/MongoTest
When use sort method to sort fields, it will return wrong sort result sometime.
Key code:
cursor, err := coll.Find(context.TODO(), bson.M{}, options.Find().SetSort( bson.M{"type": 1, "created": -1}))
Expect:
Actual(Sometimes):
Command is always correct.
db.coll.find().sort({"type": 1, "created_at":-1})