[SERVER-20660] mongos includes $sortKey field in returned documents when sorting by $natural Created: 28/Sep/15  Updated: 07/Oct/15  Resolved: 28/Sep/15

Status: Closed
Project: Core Server
Component/s: Querying, Sharding
Affects Version/s: None
Fix Version/s: 3.1.9

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: David Storch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

With the latest nightly and a sharded cluster, connect to a mongos server

mongos> db.test.insert({x : 1})
 "_id" : ObjectId("5609546fc70c85ac8d3dc863"), "x" : 1 }
mongos> db.test.find().sort({'$natural' : 1})
{ "_id" : ObjectId("5609546fc70c85ac8d3dc863"), "x" : 1, "$sortKey" : { "" : null } }

Sprint: QuInt A (10/12/15)
Participants:

 Description   

When sorting by {$natural : 1}, mongos includes the following element in returned documents:

"$sortKey" : { "" : null }



 Comments   
Comment by Githook User [ 28/Sep/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-20660 fix mongos to not pass sortKey meta-projection with a $natural sort
Branch: master
https://github.com/mongodb/mongo/commit/640902d3f0fd65c0188ef057706746fb9f5eaa87

Generated at Thu Feb 08 03:54:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.