-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: manual
-
Labels:None
The documentation refers to updateExisting, but the field is actually updatedExisting.
In MongoDB 2.4.x, upserted is only present in the GLE response if the update did not already include an _id field. In 2.5.x, it appears to always be included (if updatedExisting is false, that is), but it may not always be an ObjectId. It could very well be the existing _id that was in the update criteria for the upserted document.