Docs Menu
Docs Home
/ / /
PHP Library Manual
/ /

MongoDB\Client::getReadConcern()

On this page

  • Definition
  • Return Values
  • Example
  • See Also

New in version 1.2.

MongoDB\Client::getReadConcern()

Returns the read concern for this client.

function getReadConcern(): MongoDB\Driver\ReadConcern

A MongoDB\Driver\ReadConcern object.

<?php
$client = new MongoDB\Client('mongodb://127.0.0.1/', [
'readConcernLevel' => 'majority',
]);
var_dump($client->getReadConcern());

The output would then resemble:

object(MongoDB\Driver\ReadConcern)#5 (1) {
["level"]=>
string(8) "majority"
}
  • Read Concern in the MongoDB manual

  • MongoDB\Driver\ReadConcern::isDefault()

  • MongoDB\Collection::getReadConcern()

  • MongoDB\Database::getReadConcern()

  • MongoDB\GridFS\Bucket::getReadConcern()

← getManager()