GetLastError After Upsert Should Include New _id

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • 1.5.4
    • Affects Version/s: 1.5.3
    • Component/s: None
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The lastErrorObject should contain the newly inserted _id value from the upsert.

      > db.test.update(

      {foo:1}

      , {$set:{blah:1}}, 1, 1)
      > db.getLastErrorObj()

      { "err" : null, "updatedExisting" : false, "n" : 1, "ok" : true }

      > db.test.find()

      { "_id" : ObjectId("4c0155b806510000000000e7"), "blah" : 1, "foo" : 1 }

      I would expect the lastErrorObject to look something like this:

      { "err" : null, "updatedExisting" : false, "n" : 1, "ok" : true, inserted_id: ObjectId("4c0155b806510000000000e7")}

            Assignee:
            Eliot Horowitz (Inactive)
            Reporter:
            Scott Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: