-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 1.3.1
-
Component/s: None
-
None
-
Environment:- PHP 7.2.4
- MongoDB v3.6.3
- PHP MongoDB extension version 1.4.2
- Mongo PHP Adapter by alcaeus/mongo-php-adapter
If I perform a findAndModify query on a replicaset, and a readConcern is set "majority" on instantiation of the MongoClient, an exception is thrown: "Command does not support non local read concern".
Steps to reproduce:
$mongoClient = new \MongoClient("mongodb://127.0.0.1:27019,127.0.0.1:27020,127.0.0.1:27021/?readConcernLevel=majority"); $collection = $mongoClient->testdb->user; $collection->findAndModify( array('_id' => new MongoId('55d445973e019c996c78b08e')), array('$set' => array('test' => 'success')) );
The mongoDB function "findAndModify" supports only "local" readConcerns. However, the mongo-php-library uses the readConcern from the server string in the constructor in the MongoClient class.
- is related to
-
PHPLIB-316 Migrate Operation classes to use read and write command methods
- Closed
- links to