|
MongoDB\Driver\ReadPreference::__constructConstruct immutable ReadPreference Description
final public MongoDB\Driver\ReadPreference::__construct
( int
$mode
[, array $tagSets = NULL
[, array $options = []
]] )Creates a new ReadPreference. Parameters
Errors/Exceptions
Changelog
ExamplesExample #1 MongoDB\Driver\ReadPreference::__construct example
<?php The above example will output: object(MongoDB\Driver\ReadPreference)#1 (1) { ["mode"]=> string(18) "secondaryPreferred" } object(MongoDB\Driver\ReadPreference)#1 (2) { ["mode"]=> string(7) "nearest" ["tags"]=> array(1) { [0]=> object(stdClass)#2 (1) { ["dc"]=> string(2) "ny" } } } object(MongoDB\Driver\ReadPreference)#1 (2) { ["mode"]=> string(9) "secondary" ["maxStalenessSeconds"]=> int(120) } See Also |