[SERVER-16601] findAndModify should report that remove and update options conflict Created: 18/Dec/14  Updated: 23/Jan/15  Resolved: 19/Jan/15

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: 2.8.0-rc3
Fix Version/s: 3.0.0-rc6

Type: Bug Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Daniel Pasette (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-15715 find_and_modify appears to be taking ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

db.foo.drop();
db.foo.insert({x:1});
db.foo.findAndModify({query:{x:1}, update:{y:1}, remove:true, sort: {x:1}});

Participants:

 Description   

In versions before 2.8.0-RC3, attempting to use update and remove at the same time in findAndModify resulted in an error when sort was specified. This validation appears to have been removed in this commit (perhaps inadvertently).

With the validation removed, the remove appears to take precedence.

When sort is not specified, remove always takes precedence without warning the about the conflicting options.



 Comments   
Comment by Githook User [ 19/Jan/15 ]

Author:

{u'username': u'monkey101', u'name': u'Dan Pasette', u'email': u'dan@10gen.com'}

Message: SERVER-16601 error out on conflicting params to findAndModify
Branch: master
https://github.com/mongodb/mongo/commit/c50f274e1f232c498d411c98d6d0e4ff30df9ec3

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