Priority: Major - P3
Server versions before 2.6 only return the 'upserted' field in an update result when the upserted _id is an ObjectId. If the user provides any other value for _id in the query spec, or update document (for a replace operation) the upserted field is not returned. This causes invalid counts for nUpserted in the Bulk API result set.
The purpose of this ticket is to work around the issue in all drivers.
In all of these examples the server upserts a new document but does not return the _id of the document inserted:
There is a code review for the workaround in python here: