-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: 3.4, 3.5, 3.6
-
Component/s: Command Ops, Write Ops
-
None
Instead of omitting the writeConcern when no fields are set, PyMongo adds an empty writeConcern. This only happens with Python 2. The fix is to define the __nonzero__ method on the WriteConcern class. __nonzero__ was renamed to __bool__ in Python 3.
Note: I don't think there is any difference on the server between calling a command with an empty writeConcern document vs omitting the writeConcern. This will just save some bytes on the network and make pymongo adhere to the read-write-concern spec.
- is caused by
-
PYTHON-1101 Support sending writeConcern for commands that write
- Closed
- is duplicated by
-
PYTHON-1525 Empty WriteConcern is truthy in Python 2
- Closed