(mongodb >=1.0.0)
MongoDB\Driver\Manager::selectServer — Select a server matching a read preference
$readPreference
)
Selects a MongoDB\Driver\Server matching
readPreference
. This may be used to preselect a server
in order to perform version checking before executing an operation.
Note:
Unlike MongoDB\Driver\Manager::getServers(), this method will initialize database connections and perform server discovery if necessary. See the » Server Selection Specification for additional information.
readPreference
(MongoDB\Driver\ReadPreference)Optionnellement, une MongoDB\Driver\ReadPreference vers laquelle la commande sera routée. Si rien n'est fourni, ce sera les préférences de lecture définies par l' URI de connexion MongoDB.
Returns an MongoDB\Driver\Server matching the read preference.