Navigation
This version of the documentation is archived and no longer supported. To learn how to upgrade your version of PHP Library Manual, refer to the upgrade documentation.

MongoDB\Client::getReadConcern()

New in version 1.2.

Definition

MongoDB\Client::getReadConcern

Returns the read concern for this client.

function getReadConcern(): MongoDB\Driver\ReadConcern

Return Values

A MongoDB\Driver\ReadConcern object.

Example

<?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"
}