mongodb\Connection setLogBuilder()

setLogBuilder() public method (available since version 2.1) Sets log builder used for this connection. public void setLogBuilder ( $logBuilder )$logBuilder array|string|yii\mongodb\LogBuilder The log builder for this connection.

mongodb\Connection setQueryBuilder()

setQueryBuilder() public method (available since version 2.1) Sets the query builder for the this MongoDB connection. public void setQueryBuilder ( $queryBuilder )$queryBuilder yii\mongodb\QueryBuilder|array|string|null The query builder for this MongoDB connection.

mongodb\Connection setDefaultDatabaseName()

setDefaultDatabaseName() public method Sets default database name. public void setDefaultDatabaseName ( $name )$name string Default database name.

mongodb\Connection selectDatabase()

selectDatabase() protected method Selects the database with given name. protected yii\mongodb\Database selectDatabase ( $name )$name string Database name. return yii\mongodb\Database Database instance.

mongodb\Connection registerFileStreamWrapper()

registerFileStreamWrapper() public method Registers GridFS stream wrapper for the $fileStreamProtocol protocol. public string registerFileStreamWrapper ( $force = false )$force boolean Whether to enforce registration even wrapper has been already registered. return string Registered stream protocol name.

mongodb\Connection open()

open() public method Establishes a Mongo connection. It does nothing if a MongoDB connection has already been established. public void open ( )throws yii\mongodb\Exception if connection fails

mongodb\Connection initConnection()

initConnection() protected method Initializes the DB connection. This method is invoked right after the DB connection is established. The default implementation triggers an EVENT_AFTER_OPEN event. protected void initConnection ( )

mongodb\Connection getLogBuilder()

getLogBuilder() public method (available since version 2.1) Returns log builder for this connection. public yii\mongodb\LogBuilder getLogBuilder ( )return yii\mongodb\LogBuilder The log builder for this connection.

mongodb\Connection getFileCollection()

getFileCollection() public method Returns the MongoDB GridFS collection. public yii\mongodb\file\Collection getFileCollection ( $prefix = 'fs', $refresh = false )$prefix string|array Collection prefix. If string considered as the prefix of the GridFS collection inside the default database. If array - first element considered as the name of the database, second - as prefix of the GridFS collection inside that database, if no second element present default "fs" prefix will be used. $ref

mongodb\Connection getIsActive()

getIsActive() public method Returns a value indicating whether the Mongo connection is established. public boolean getIsActive ( )return boolean Whether the Mongo connection is established