--TEST-- MongoDB\Driver\Server::executeReadWriteCommand() --SKIPIF-- --FILE-- selectServer(new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY)); (new CommandObserver)->observe( function() use ($server) { $command = new MongoDB\Driver\Command( [ 'findAndModify' => NS, 'update' => [ '$set' => [ 'foo' => 'bar' ] ], ] ); $server->executeReadWriteCommand( DATABASE_NAME, $command, [ 'readConcern' => new \MongoDB\Driver\ReadConcern(\MongoDB\Driver\ReadConcern::LOCAL), 'writeConcern' => new \MongoDB\Driver\WriteConcern(\MongoDB\Driver\WriteConcern::MAJORITY), ] ); }, function(stdClass $command) { echo "Read Concern: ", $command->readConcern->level, "\n"; echo "Write Concern: ", $command->writeConcern->w, "\n"; } ); ?> ===DONE=== --EXPECTF-- Read Concern: local Write Concern: majority ===DONE===