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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.9
    • Component/s: Querying, Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      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 } }
    • Sprint:
      QuInt A (10/12/15)

      Description

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

      "$sortKey" : { "" : null }
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: