[CDRIVER-2213] Add write concern option to find_and_modify_with_opts Created: 17/Jul/17 Updated: 28/Oct/23 Resolved: 01/Sep/17 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | 1.8.0 |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Patrick Freed | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||||||||||
| Description |
|
The findAndModify command accepts a write concern option different from the collection-wide write concern. As such, mongoc_collection_find_and_modify_with_opts should accept a write concern as an option via find_and_modify_opts_t. According to read/write concern spec, this function should also throw an error if a write concern is specified and maxWireVersion < 4. |
| Comments |
| Comment by Githook User [ 01/Sep/17 ] |
|
Author: {'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}Message: |
| Comment by Githook User [ 01/Sep/17 ] |
|
Author: {'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}Message: |
| Comment by A. Jesse Jiryu Davis [ 20/Jul/17 ] |
|
We still need to check whether our mongoc_collection_find_and_modify_with_opts throws an error if wire version < 4. |
| Comment by A. Jesse Jiryu Davis [ 20/Jul/17 ] |
|
You can use mongoc_write_concern_append (write_concern, bson) to create an "opts" that includes the write concern, then pass that to mongoc_find_and_modify_opts_append. |