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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor - P4 Minor - P4
    • None
    • 3.0.2
    • 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" }}

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: