Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20660

mongos includes $sortKey field in returned documents when sorting by $natural

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.9
    • Affects Version/s: None
    • Component/s: Querying, Sharding
    • None
    • Fully Compatible
    • ALL
    • Hide

      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 } }
      
      Show
      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 } }
    • QuInt A (10/12/15)

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

      "$sortKey" : { "" : null }
      

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: