-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
In 21b7d92 for PHPLIB-200, we noted:
In the future, we should throw an exception if the "writeConcern" option is specified and not supported by the server (see: SPEC-494). For BC in 1.x, we will silently omit it for incompatible servers.
Since SPEC-494 has been resolved, the Read and Write Concern specification now states:
If writeConcern is specified for the Collection, writeConcern MUST be omitted when sending findAndModify with MaxWireVersion < 4.
If the findAndModify helper accepts writeConcern as a parameter, the driver MUST raise an error with MaxWireVersion < 4.
The Collection's findAndModify helpers always omitted inheritance of the Collection's write concern if it was not supported by the server, so throwing an exception in the operation class should only affect users that were explicitly providing the option on older servers (where it was previously ignored). Rather than keep that behavior for the duration of 1.x and ignore the unsupported option just for findAndModify commands, we can raise an UnsupportedException as is done for other commands helpers that now support a write concern in 3.4+.
- is related to
-
PHPLIB-200 Support sending writeConcern for commands that write
- Closed
- related to
-
PHPLIB-229 Operations should not accept unsupported read concern options
- Closed