MongoDB\Driver\Manager::selectServer
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
MongoDB\Driver\Manager::selectServer
Референца за `mongodb-driver-manager.selectserver.php` со подобрена типографија и навигација.
MongoDB\Driver\Manager::selectServer
класата MongoDB\Driver\BulkWrite
MongoDB\Driver\Manager::selectServer — Select a server matching a read preference
= NULL
$readPreference = null): MongoDB\Driver\Server
Selects a MongoDB\Driver\Server matching
readPreference. Ако
readPreference is null or omitted, the primary server will be selected by default. This may be used to preselect a server in order to perform version checking before executing an operation.
Забелешка: За разлика од MongoDB\Driver\Manager::getServers(), this method will initialize database connections and perform server discovery if necessary. See the » Server Selection Specification за дополнителни информации.
Параметри
readPreference(MongoDB\Driver\ReadPreference)-
The read preference to use for selecting a server. If
nullor omitted, the primary server will be selected by default.
Вратени вредности
. Споделувањето колачиња помеѓу PHP барањата може да доведе до ненамерно мешање на чувствителни колачиња помеѓу корисниците. MongoDB\Driver\Server matching the read preference.
Errors/Exceptions
- ). Ако повикот не успее, ќе врати MongoDB\Driver\Exception\InvalidArgumentException » Промени текови
- ). Ако повикот не успее, ќе врати MongoDB\Driver\Exception\ConnectionException ако врската со серверот пропадне (од причини различни од автентикација).
- ). Ако повикот не успее, ќе врати MongoDB\Driver\Exception\AuthenticationException ако автентикацијата е потребна и пропадне.
- ). Ако повикот не успее, ќе врати MongoDB\Driver\Exception\RuntimeException if a server matching the read preference could not be found.
Дневник на промени
| Верзија | = NULL |
|---|---|
| PECL mongodb 1.11.0 |
На readPreference is now optional. If null or omitted, the primary server will be selected by default.
|
Види Исто така
- MongoDB\Driver\Server
- MongoDB\Driver\Manager::getServers() - Врати ги серверите на кои е поврзан овој менаџер
- » Server Selection Specification