mongodb\Connection getQueryBuilder()

getQueryBuilder() public method (available since version 2.1) Returns the query builder for the this MongoDB connection. public yii\mongodb\QueryBuilder getQueryBuilder ( )return yii\mongodb\QueryBuilder The query builder for the this MongoDB connection.

mongodb\Connection getDefaultDatabaseName()

getDefaultDatabaseName() public method Returns default database name, if it is not set, attempts to determine it from $dsn value. public string getDefaultDatabaseName ( )return string Default database name throws yii\base\InvalidConfigException if unable to determine default database name.

mongodb\Connection getDatabase()

getDatabase() public method Returns the MongoDB database with the given name. public yii\mongodb\Database getDatabase ( $name = null, $refresh = false )$name string|null Database name, if null default one will be used. $refresh boolean Whether to reestablish the database connection even, if it is found in the cache. return yii\mongodb\Database Database instance.

mongodb\Connection EVENT_AFTER_OPEN

EVENT_AFTER_OPEN event of type \yii\mongodb\Event An event that is triggered after a DB connection is established

mongodb\Connection getCollection()

getCollection() public method Returns the MongoDB collection with the given name. public yii\mongodb\Collection getCollection ( $name, $refresh = false )$name string|array Collection name. If string considered as the name of the collection inside the default database. If array - first element considered as the name of the database, second - as name of collection inside that database $refresh boolean Whether to reload the collection instance even if it is found in the cache. return y

mongodb\Connection $typeMap

$typeMap public property (available since version 2.1) Type map to use for BSON unserialization. Note: default type map will be automatically merged into this field, possibly overriding user-defined values. See also http://php.net/manual/en/mongodb-driver-cursor.settypemap.php. public array $typeMap = []

mongodb\Connection $queryBuilder

$queryBuilder public property The query builder for the this MongoDB connection. public yii\mongodb\QueryBuilder getQueryBuilder ( )public void setQueryBuilder ( $queryBuilder )

mongodb\Connection close()

close() public method Closes the currently active DB connection. It does nothing if the connection is already closed. public void close ( )

mongodb\Connection createCommand()

createCommand() public method (available since version 2.1) Creates MongoDB command. public yii\mongodb\Command createCommand ( $document = [], $databaseName = null )$document array Command document contents. $databaseName string|null Database name, if not set $defaultDatabaseName will be used. return yii\mongodb\Command Command instance.

mongodb\Connection $options

$options public property Connection options. For example: [ 'socketTimeoutMS' => 1000, // how long a send or receive on a socket can take before timing out 'ssl' => true // initiate the connection with TLS/SSL ] See also https://docs.mongodb.com/manual/reference/connection-string/#connections-connection-options. public array $options = []