-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
When talking with server 3.4 or greater (maxWireVersion >=5), writeConcern is a supported option for all commands that write.
The following methods and helpers should be updated to automatically pass writeConcern when maxWireVersion >= 5:
Methods:
- Collection.__create
Helpers:
- MongoClient.drop_database
- Database.drop_collection
- Collection.aggregate (when using $out)
- Collection.create_indexes
- Collection.create_index
- Collection.ensure_index
- Collection.drop_indexes
- Collection.drop_index
- Collection.map_reduce (when using $out)
- Collection.reindex
- Collection.rename
Note:
When the writeConcern on a command that writes fails, the resulting document still comes back with ok: 1. To check for write concern and raise the appropriate error, we need to check the result document for a writeConcernError field.
- causes
-
PYTHON-1527 Default WriteConcern does not override in get_database, get_collection, with_options
- Closed
-
PYTHON-1543 Some write operations raise WriteConcernError instead of WTimeoutError
- Closed
-
PYTHON-1523 PyMongo adds empty writeConcern to commands with Python 2
- Closed
-
PYTHON-1525 Empty WriteConcern is truthy in Python 2
- Closed
- is depended on by
-
DRIVERS-290 Support sending writeConcern for commands that write
- Closed