-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.3.3
-
Component/s: Querying
-
Labels:None
-
Environment:Mac OS
Discovered to day that a sort on multiple fields fails when one is _id. In this case, I'm using a String as my _id, so it's relevant to sort on this field. Sorting just on _id or another fields works, but if I sort by another field and then _id, only _id sorting is performed. I compared with a multi-field sort not using _id (in this case "level" and "value_type") and this worked as expected: sorting occurred by level and then by value_type.
Sorts only by _id:
db.foo.find().sort(
)
Sorts properly by both keys:
db.foo.find().sort(
)