[SERVER-5289] _id field not taken from query during upsert on update Created: 12/Mar/12  Updated: 10/Jan/17  Resolved: 01/Aug/13

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: 2.5.2

Type: Bug Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 0
Labels: _id, update, upsert
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-18075 Behavior of Mongo update is different... Closed
Related
is related to SERVER-1173 GetLastError After Upsert Should Incl... Closed
is related to SERVER-18076 Upsert rejected with error if _id ass... Closed
Operating System: ALL
Participants:

 Description   

> db.u.update({_id:1}, {name:1}, true)
> db.u.find()
{ "_id" : ObjectId("4f5e509be3438c7dbcf2b056"), "name" : 1 }

should produce this:

> db.u.find()
{ "_id" : 1, "name" : 1 }



 Comments   
Comment by Githook User [ 10/Jan/17 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: SPEC-173: Improve server compatibility for findAndModify tests

This splits the findOneAndReplace upsert tests into their own file so that we can work around SERVER-5289 for pre-2.6 servers.

Additionally, we remove the sort option from all findAndModify upsert tests where no document would match to work around SERVER-17650 for pre-3.0 servers.
Branch: master
https://github.com/mongodb/specifications/commit/f141fe8352f8a43625bab7802acb8f1a9b82335e

Comment by Githook User [ 10/Jan/17 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: SPEC-173: Split update tests for pre-2.6 servers

Update results do not include modifiedCount for pre-2.6 servers. Additionally, SERVER-5289 prevents us from verifying the ID for a document upserted by a replaceOne operation if the ID was only specified in the filter document.
Branch: master
https://github.com/mongodb/specifications/commit/3b06646c82ad70306bc114c4b5f41783885409dc

Comment by Githook User [ 24/Oct/16 ]

Author:

{u'username': u'estolfo', u'name': u'Emily', u'email': u'emily@mongodb.com'}

Message: Remove maxServerVersion if no value, reference SERVER-5289, fix filename typo
Branch: master
https://github.com/mongodb/specifications/commit/9f599de0ceb6455c9a23820bd95d6c0cc1ab1b00

Comment by auto [ 01/Aug/13 ]

Author:

{u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}

Message: SERVER-5289: use query _id for replacement
Branch: master
https://github.com/mongodb/mongo/commit/5647c97e2b618144801c75651f59010088823810

Generated at Thu Feb 08 03:08:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.