-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.4.9, 2.6.0-rc2
-
Component/s: Querying
-
None
-
ALL
>db.test.drop() >db.test.insert([{a:[{b:{c:3}}, 1]}, {a:[{b:{c:5}},1]}, {a:[{b:{c:4}},1]}]) >db.test.find().sort({'a.b.c':1}) { "_id" : ObjectId("5339c1f58b8794d6f2676019"), "a" : [ { "b" : { "c" : 3 } }, 1 ] } { "_id" : ObjectId("5339c1f58b8794d6f267601a"), "a" : [ { "b" : { "c" : 5 } }, 1 ] } { "_id" : ObjectId("5339c1f58b8794d6f267601b"), "a" : [ { "b" : { "c" : 4 } }, 1 ] }
should the {a:[{b:{c:5}},1]} be the last doc? They do if they don't have the 1 in the array.
>db.test.drop() >db.test.insert([{a:[{b:{c:3}}]}, {a:[{b:{c:5}}]}, {a:[{b:{c:4}}]}]) >db.test.find().sort({'a.b.c':1}) { "_id" : ObjectId("5339d2a26d764829de404bec"), "a" : [ { "b" : { "c" : 3 } } ] } { "_id" : ObjectId("5339d2a26d764829de404bee"), "a" : [ { "b" : { "c" : 4 } } ] } { "_id" : ObjectId("5339d2a26d764829de404bed"), "a" : [ { "b" : { "c" : 5 } } ] }
- is duplicated by
-
SERVER-20551 sort on multikey index after $elemMatch projection
- Closed
- related to
-
SERVER-11878 Results in incorrect order for sharded query with bounded sort on multi-key field
- Closed