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

dot notation of projections doesn't work on embedded "_id" field

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.0.2
    • Component/s: Querying
    • None
    • ALL
    • Hide
      db.test.save({ "_id" : { "d" : "x", "f" : "z" }})
      db.test.find({},{"_id.d":1})  // should return {_id:{d:"x"}} instead of { "_id" : { "d" : "x", "f" : "z" }}
      
      Show
      db.test.save({ "_id" : { "d" : "x" , "f" : "z" }}) db.test.find({},{ "_id.d" :1}) // should return {_id:{d: "x" }} instead of { "_id" : { "d" : "x" , "f" : "z" }}
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      If "_id" is an embedded field, then dot notation of projections doesn't work on that field.
      I think "_id" field should be able to projection to avoid unnecessary data transform

            Assignee:
            Unassigned Unassigned
            Reporter:
            jiahongchao Jia Hongchao
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: