|
| __construct (?string $uri=null, array $uriOptions=[], array $driverOptions=[]) |
| Constructs a new Client instance.
|
|
| __debugInfo () |
| Return internal properties for debugging purposes.
|
|
| __get (string $databaseName) |
| Select a database.
|
|
| __toString () |
| Return the connection string (i.e.
|
|
| createClientEncryption (array $options) |
| Returns a ClientEncryption instance for explicit encryption and decryption.
|
|
| dropDatabase (string $databaseName, array $options=[]) |
| Drop a database.
|
|
| getManager () |
| Return the Manager.
|
|
| getReadConcern () |
| Return the read concern for this client.
|
|
| getReadPreference () |
| Return the read preference for this client.
|
|
| getTypeMap () |
| Return the type map for this client.
|
|
| getWriteConcern () |
| Return the write concern for this client.
|
|
| listDatabaseNames (array $options=[]) |
| List database names.
|
|
| listDatabases (array $options=[]) |
| List databases.
|
|
| selectCollection (string $databaseName, string $collectionName, array $options=[]) |
| Select a collection.
|
|
| selectDatabase (string $databaseName, array $options=[]) |
| Select a database.
|
|
| startSession (array $options=[]) |
| Start a new client session.
|
|
| watch (array $pipeline=[], array $options=[]) |
| Create a change stream for watching changes to the cluster.
|
|
|
const | DEFAULT_URI = 'mongodb://127.0.0.1/' |
|
◆ __construct()
MongoDB\Client::__construct |
( |
?string | $uri = null, |
|
|
array | $uriOptions = [], |
|
|
array | $driverOptions = [] ) |
◆ __debugInfo()
MongoDB\Client::__debugInfo |
( |
| ) |
|
◆ __get()
MongoDB\Client::__get |
( |
string | $databaseName | ) |
|
◆ __toString()
MongoDB\Client::__toString |
( |
| ) |
|
Return the connection string (i.e.
URI).
- Return values
-
◆ createClientEncryption()
MongoDB\Client::createClientEncryption |
( |
array | $options | ) |
|
Returns a ClientEncryption instance for explicit encryption and decryption.
- Parameters
-
array | $options | Encryption options |
- Return values
-
◆ dropDatabase()
MongoDB\Client::dropDatabase |
( |
string | $databaseName, |
|
|
array | $options = [] ) |
Drop a database.
- See also
- DropDatabase\__construct() for supported options
- Parameters
-
string | $databaseName | Database name |
array | $options | Additional options |
- Return values
-
array|object | Command result document |
- Exceptions
-
UnsupportedException | if options are unsupported on the selected server |
InvalidArgumentException | for parameter/option parsing errors |
DriverRuntimeException | for other driver errors (e.g. connection errors) |
◆ getManager()
MongoDB\Client::getManager |
( |
| ) |
|
Return the Manager.
- Return values
-
◆ getReadConcern()
MongoDB\Client::getReadConcern |
( |
| ) |
|
◆ getReadPreference()
MongoDB\Client::getReadPreference |
( |
| ) |
|
Return the read preference for this client.
- Return values
-
◆ getTypeMap()
MongoDB\Client::getTypeMap |
( |
| ) |
|
Return the type map for this client.
- Return values
-
◆ getWriteConcern()
MongoDB\Client::getWriteConcern |
( |
| ) |
|
◆ listDatabaseNames()
MongoDB\Client::listDatabaseNames |
( |
array | $options = [] | ) |
|
List database names.
- See also
- ListDatabaseNames\__construct() for supported options
- Exceptions
-
UnexpectedValueException | if the command response was malformed |
InvalidArgumentException | for parameter/option parsing errors |
DriverRuntimeException | for other driver errors (e.g. connection errors) |
◆ listDatabases()
MongoDB\Client::listDatabases |
( |
array | $options = [] | ) |
|
List databases.
- See also
- ListDatabases\__construct() for supported options
- Return values
-
- Exceptions
-
UnexpectedValueException | if the command response was malformed |
InvalidArgumentException | for parameter/option parsing errors |
DriverRuntimeException | for other driver errors (e.g. connection errors) |
◆ selectCollection()
MongoDB\Client::selectCollection |
( |
string | $databaseName, |
|
|
string | $collectionName, |
|
|
array | $options = [] ) |
Select a collection.
- See also
- Collection\__construct() for supported options
- Parameters
-
string | $databaseName | Name of the database containing the collection |
string | $collectionName | Name of the collection to select |
array | $options | Collection constructor options |
- Return values
-
- Exceptions
-
InvalidArgumentException | for parameter/option parsing errors |
◆ selectDatabase()
MongoDB\Client::selectDatabase |
( |
string | $databaseName, |
|
|
array | $options = [] ) |
Select a database.
- See also
- Database\__construct() for supported options
- Parameters
-
string | $databaseName | Name of the database to select |
array | $options | Database constructor options |
- Return values
-
- Exceptions
-
InvalidArgumentException | for parameter/option parsing errors |
◆ startSession()
MongoDB\Client::startSession |
( |
array | $options = [] | ) |
|
◆ watch()
MongoDB\Client::watch |
( |
array | $pipeline = [], |
|
|
array | $options = [] ) |
Create a change stream for watching changes to the cluster.
- See also
- Watch\__construct() for supported options
- Parameters
-
array | $pipeline | List of pipeline operations |
array | $options | Command options |
- Return values
-
- Exceptions
-
InvalidArgumentException | for parameter/option parsing errors |
The documentation for this class was generated from the following file:
- cache/stores/mongodb/MongoDB/Client.php