the id isn't included in at least two cases where it probably should for consistency
if the _id wasn't generated server-side:
> db.foo.update({_id:'asdf'}, {$set: {a:'123'}}, true)
> db.getLastErrorObj()
> db.foo.update(
{a:'asdf'}, {_id: 'qwer'}, true)
> db.getLastErrorObj()
if the object already existed:
> db.foo.update({_id:{$gt: ObjectId("4c2e342e38535540224f7945")}}, {$set: {a:'123'}}, true)
> db.getLastErrorObj()
> db.foo.update({_id:{$gt: ObjectId("4c2e342e38535540224f7945")}}, {$set: {a:'123'}}, true)
> db.getLastErrorObj()
- is depended on by
-
SERVER-2625 Mongo throws uncaught exception while perfoming findAndModify trying to return newly created document
- Closed
- is related to
-
SERVER-13865 Shell returns incorrect WriteResult for compatibility-mode upsert with non-OID equality pred on _id field
- Closed
-
SERVER-10302 Use new update framework to enforce presence of _id in upserts
- Closed
-
SERVER-1173 GetLastError After Upsert Should Include New _id
- Closed
-
SERVER-9958 $setOnInsert should allow _id to be set
- Closed