[SERVER-1561] sorting doesn't work if sort field not included in projection Created: 03/Aug/10  Updated: 12/Jul/16  Resolved: 04/Aug/10

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 1.6.0

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

load server with something like this:
for (var i=0; i< 1000000;i++) {var r = Math.random(); db.foo.insert(

{i:i, r:r, rr:r, s:s}

)}
db.foo.ensureIndex(

{r:1}

)

test with this:
r=-1
db.foo.find({},

{rr:1}

).sort(

{r:1}

).forEach(function(z){ if (z.rr <= r)

{printjson(z);print(r)}

r= z.rr})

you will see one printout each time mongos switches shards



 Comments   
Comment by auto [ 04/Aug/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: fix sorting if sort field not included in projection SERVER-1561
http://github.com/mongodb/mongo/commit/63f894763de77a0be4a67d665b87298736604ba3

Comment by auto [ 04/Aug/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: fix sorting if sort field not included in projection SERVER-1561
http://github.com/mongodb/mongo/commit/51ac96b84420846af5dc6e5ca8d142e48834bbb8

Generated at Thu Feb 08 02:57:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.