-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.2.2
-
Environment:centos 6.3
-
ALL
the document is like the following:
{A:1, B:[{C:1, D:1}]} {A:1, B:[{C:5, D:2}]}
my sort command is like:
db.xxx.find().sort({B.C:1})
it works well under single server mode, but the result may not be properly sorted under shard environment.
it seems the mongos only fetchs data from one sharded node serially, for exmpale:
shard1:
{A:1, B:[{C:4, D:1}]} {A:1, B:[{C:5, D:2}]}
shard2:
{A:1, B:[{C:1, D:1}]} {A:1, B:[{C:2, D:2}]}
after db.xxx.find().sort({B.C:1}), it returns like:
{A:1, B:[{C:4, D:1}]} {A:1, B:[{C:5, D:2}]} {A:1, B:[{C:1, D:1}]} {A:1, B:[{C:2, D:2}]}
I'm not sure if it's the similar bug of https://jira.mongodb.org/browse/SERVER-6118, since it's on array element while 6118 is on non-array element.
- is related to
-
SERVER-11878 Results in incorrect order for sharded query with bounded sort on multi-key field
- Closed