MongoDB\Driver\Manager
PHP Manual

MongoDB\Driver\Manager::selectServer

(mongodb >=1.0.0)

MongoDB\Driver\Manager::selectServerSelect a server matching a read preference

Beschreibung

final public MongoDB\Driver\Server MongoDB\Driver\Manager::selectServer ( MongoDB\Driver\ReadPreference $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.

Parameter-Liste

readPreference

Optionally, a MongoDB\Driver\ReadPreference to route the command to. If none given, defaults to the Read Preferences set by the MongoDB Connection URI.

Rückgabewerte

Returns an MongoDB\Driver\Server matching the read preference.

Fehler/Exceptions

Siehe auch


MongoDB\Driver\Manager
PHP Manual