-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
Currently database, collection and gridfs take write concern as :write option while session and operations take it as :write_concern option. This discrepancy is error-prone because lower level code does not error when given :write option, but silently behaves not as expected. Similarly collection will accept :write_concern and ignore it. Additionally we do not have great documentation explaining this difference.
Since :write_concern seems to be a better name choice compared to :write, this ticket proposes to add :write_concern to collection and client options as an alternative to :write, so that applications can use :write_concern everywhere.
Important points:
- Client and collection will accept both :write and :write_concern.
- If both are given together, their values must be identical or an exception will be raised.
- Whatever option is given by the caller will be stored (i.e. at this point the driver will not replace the key name in options).