When talking with server 3.4 or greater (maxWireVersion >=5), writeConcern should be a supported option for commands that write.
Helpers for the following commands therefore must be updated to support the option.
These are commands that newly accept a writeConcern as of 3.4, for which driver helpers should be updated:
- aggregate with $out
- clone
- cloneCollection
- cloneCollectionAsCapped
- collMod
- convertToCapped
- copydb
- create
- createIndexes
- drop
- dropDatabase
- dropIndexes
- reindex
- mapReduce with out
- renameCollection
Note:
When the writeConcern on a command that writes fails, the resulting document still comes back with ok: 1. Hence, to check for write concern and raise the appropriate error to your users, you will need to check the resulting document for a writeConcernError field. If it is present, then writeConcern failed.
See the specs here for details on writeConcern with the generic command method. See the specs here for details on handling writeConcern with command helpers.
- depends on
-
CDRIVER-1322 Support sending writeConcern for commands that write
- Closed
-
CSHARP-1688 Support sending writeConcern for commands that write
- Closed
-
CXX-926 Support sending writeConcern for commands that write
- Closed
-
CXX-927 Support sending writeConcern for commands that write
- Closed
-
JAVA-2221 Always send writeConcern for commands that write
- Closed
-
NODE-729 Support sending writeConcern for commands that write
- Closed
-
PHPLIB-200 Support sending writeConcern for commands that write
- Closed
-
PYTHON-1101 Support sending writeConcern for commands that write
- Closed
-
RUBY-1115 Support sending writeConcern for commands that write
- Closed
-
RUST-35 Add integration tests for writeConcern using command monitoring
- Closed
-
SERVER-24191 Bump wire version to indicate improved support for write concern with commands
- Closed
- is duplicated by
-
DRIVERS-294 Commands that write should take a write concern
- Closed
- is related to
-
SERVER-20224 Commands which write should take a write concern
- Closed