[SERVER-41829] findAndModify ignores filter expressions that are not objects Created: 19/Jun/19 Updated: 29/Oct/23 Resolved: 12/Jul/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.14, 4.2.0-rc3, 4.0.12, 3.4.23, 4.3.1 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | McKittrick Swindle | Assignee: | Arun Banala |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | query-44-grooming | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux OS, inside Docker (mongo) |
||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||||||
| Backport Requested: |
v4.2, v4.0, v3.6, v3.4
|
||||||||||||||||
| Steps To Reproduce: |
|
||||||||||||||||
| Sprint: | Query 2019-07-15 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
I have some basic users in a collection created by mongoose. My program code created one incorrectly, so I went into the command line to fix it. (its not a big application). I went to use the db.colleciton.findOneAndDelete(...) first, but it deleted the wrong entry. I was confused at first, but I didn't craft the query in the argument right to match a record, and it should have errored out. When I use the exact same query string in db.collection.findOne(...) it errors and doesn't continue, but with db.collection.findOneAndDelete(...) it does not error, and appears to delete the first record it found.
|
| Comments |
| Comment by Githook User [ 31/Jul/19 ] | |
|
Author: {'name': 'Arun Banala', 'username': 'banarun', 'email': 'arun.banala@mongodb.com'}Message: (cherry picked from commit de511c6bbf22d662912f228a3ac7a8e7a8bc3c61) | |
| Comment by Githook User [ 31/Jul/19 ] | |
|
Author: {'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}Message: (cherry picked from commit de511c6bbf22d662912f228a3ac7a8e7a8bc3c61) | |
| Comment by Githook User [ 31/Jul/19 ] | |
|
Author: {'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}Message: (cherry picked from commit de511c6bbf22d662912f228a3ac7a8e7a8bc3c61) | |
| Comment by Githook User [ 12/Jul/19 ] | |
|
Author: {'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}Message: (cherry picked from commit de511c6bbf22d662912f228a3ac7a8e7a8bc3c61) | |
| Comment by Githook User [ 12/Jul/19 ] | |
|
Author: {'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}Message: | |
| Comment by Asya Kamsky [ 30/Jun/19 ] | |
|
I originally thought there was a driver/shell related issue but this appears to be on the server:
You can see the query filter is nonsense: query: "abc" I think we should fix and backport if it's not too destabilizing. |