mongodb\Database listCollections()

listCollections() public method (available since version 2.1.1) Returns the list of available collections in this database. public array listCollections ( $condition = [], $options = [] )$condition array Filter condition. $options array Options list. return array Collections information.

mongodb\Database getFileCollection()

getFileCollection() public method Returns Mongo GridFS collection with given prefix. public yii\mongodb\file\Collection getFileCollection ( $prefix = 'fs', $refresh = false )$prefix string Collection prefix. $refresh boolean Whether to reload the collection instance even if it is found in the cache. return yii\mongodb\file\Collection Mongo GridFS collection.

mongodb\Database getCollection()

getCollection() public method Returns the Mongo collection with the given name. public yii\mongodb\Collection getCollection ( $name, $refresh = false )$name string Collection name $refresh boolean Whether to reload the collection instance even if it is found in the cache. return yii\mongodb\Collection Mongo collection instance.

mongodb\Database dropCollection()

dropCollection() public method (available since version 2.1) Drops specified collection. public boolean dropCollection ( $name )$name string Name of the collection return boolean Whether operation was successful.

mongodb\Database createCommand()

createCommand() public method (available since version 2.1) Creates MongoDB command associated with this database. public yii\mongodb\Command createCommand ( $document = [] )$document array Command document contents. return yii\mongodb\Command Command instance.

mongodb\Database createCollection()

createCollection() public method Creates new collection. Note: Mongo creates new collections automatically on the first demand, this method makes sense only for the migration script or for the case you need to create collection with the specific options. public boolean createCollection ( $name, $options = [] )$name string Name of the collection $options array Collection options in format: "name" => "value" return boolean Whether operation was successful. throws yii\mongodb\Except

mongodb\Database clearCollections()

clearCollections() public method Clears internal collection lists. This method can be used to break cycle references between yii\mongodb\Database and yii\mongodb\Collection instances. public void clearCollections ( )

mongodb\Database $name

$name public property Name of this database. public string $name = null

mongodb\Database $fileCollection

$fileCollection public read-only property Mongo GridFS collection. public yii\mongodb\file\Collection getFileCollection ( $prefix = 'fs', $refresh = false )

mongodb\Database $connection

$connection public property MongoDB connection. public yii\mongodb\Connection $connection = null