MongoDB\Client::getReadPreference()
On this page
New in version 1.2.
Definition
Return Values
A MongoDB\Driver\ReadPreference object.
Example
$client = new MongoDB\Client('mongodb://127.0.0.1/', [ 'readPreference' => 'primaryPreferred', ]); var_dump($client->getReadPreference());
The output would then resemble:
object(MongoDB\Driver\ReadPreference)#5 (1) { ["mode"]=> string(16) "primaryPreferred" }