[GODRIVER-1072] FindOneAndUpdate returns no error when no document found according to the filter criteria Created: 20/May/19 Updated: 27/Oct/23 Resolved: 20/May/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | 1.0.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | prakash | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux ubuntu 18.04 LTS |
||
| Description |
|
I have this schema
I am using `FindOneAndUpdate()` to find the document and update it. Its working fine for the cases in which there is a document present in the database as per the filter criteria. For cases in which there exist not document in the database as per the filter criteria, it returns no errors. What is expected that if there exist not document as per the filter criteria, the function should return an error so that the end user know that the document he is trying to update does not exist. I am using the following code
|
| Comments |
| Comment by Ian Whalen (Inactive) [ 20/May/19 ] |
|
Hey prakashpandey thanks a lot for the report - this is actually working as per the mongodb driver specification. we do however recognize that the actual user experience is sub-par so we've filed |