-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.5.3
-
Component/s: 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()
> 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")}- related to
-
SERVER-5289 _id field not taken from query during upsert on update
- Closed
-
SERVER-1351 GLE upserted _id field should always be filled in
- Closed