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

MongoDB\Database::getReadConcern()

On this page

  • Definition
  • Return Values
  • Example
  • See Also

New in version 1.2.

MongoDB\Database::getReadConcern()

Returns the read concern for this database.

function getReadConcern(): MongoDB\Driver\ReadConcern

A MongoDB\Driver\ReadConcern object.

<?php
$database = (new MongoDB\Client)->selectDatabase('test', [
'readConcern' => new MongoDB\Driver\ReadConcern('majority'),
]);
var_dump($database->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\Client::getReadConcern()

  • MongoDB\Collection::getReadConcern()

  • MongoDB\GridFS\Bucket::getReadConcern()

Back

getManager()