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

Can't $project into _id

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Aggregation Framework
    • None
    • ALL

    Description

      > db.foo.drop()
      true
      > db.foo.insert({_id:'ID', other: 'OTHER'})
      > db.foo.aggregate({$project:{_id:'$other'}})
      { "result" : [ { "_id" : "ID", "_id" : "ID" } ], "ok" : 1 }

      Expected result: {_id: 'OTHER'}

      Attachments

        Activity

          People

            mathias@mongodb.com Mathias Stearn
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: