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

Cannot project subfield of _id

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Duplicate
    • Affects Version/s: 2.4.10, 2.6.1
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None

      Description

      if _id is an object you cannot project out on of it's members in a normal projection, you can using $project in aggregation

      > db.foo.insert({_id:{a:1,b:1}})
      WriteResult({ "nInserted" : 1 })
      > db.foo.find({},{_id:0,"_id.a":1})
      {  }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-query Backlog - Query Team (Inactive)
              Reporter:
              john.page John Page
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: