mongodb\Migration dropAllIndexes()

dropAllIndexes() public method Drops all indexes for specified collection. public void dropAllIndexes ( $collection )$collection string|array Name of the collection.

mongodb\Migration dropCollection()

dropCollection() public method Drops existing collection. public void dropCollection ( $collection )$collection string|array Name of the collection

mongodb\Migration dropIndex()

dropIndex() public method Drop indexes for specified column(s). public void dropIndex ( $collection, $columns )$collection string|array Name of the collection $columns string|array Column name or list of column names.

mongodb\Migration composeCollectionLogName()

composeCollectionLogName() protected method Composes string representing collection name. protected string composeCollectionLogName ( $collection )$collection array|string Collection name. return string Collection name.

mongodb\Migration createCollection()

createCollection() public method Creates new collection with the specified options. public void createCollection ( $collection, $options = [] )$collection string|array Name of the collection $options array Collection options in format: "name" => "value"

mongodb\Migration createIndexes()

createIndexes() public method (available since version 2.1) Creates indexes in the collection. public void createIndexes ( $collection, $indexes )$collection string|array Name of the collection $indexes array Indexes specifications.

mongodb\Migration createIndex()

createIndex() public method Creates an index on the collection and the specified fields. public void createIndex ( $collection, $columns, $options = [] )$collection string|array Name of the collection $columns array|string Column name or list of column names. $options array List of options in format: optionName => optionValue.

mongodb\Migration beginProfile()

beginProfile() protected method (available since version 2.1.1) Marks the beginning of a code block for profiling. protected void beginProfile ( $token )$token string Token for the code block.

mongodb\Migration $db

$db public property The MongoDB connection object or the application component ID of the MongoDB connection that this migration should work with. Starting from version 2.0.2, this can also be a configuration array for creating the object. public yii\mongodb\Connection|array|string $db = 'mongodb'

mongodb\Migration batchInsert()

batchInsert() public method Inserts several new rows into collection. public array batchInsert ( $collection, $rows, $options = [] )$collection array|string Collection name. $rows array Array of arrays or objects to be inserted. $options array List of options in format: optionName => optionValue. return array Inserted data, each row will have "_id" key assigned to it.