mongodb\Query $from

$from public property The collection to be selected from. 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 See also from(). public string|array $from = null

mongodb\Migration save()

save() public method Update the existing database data, otherwise insert this data public \MongoDB\BSON\ObjectID save ( $collection, $data, $options = [] )$collection array|string Collection name. $data array|object Data to be updated/inserted. $options array List of options in format: optionName => optionValue. return \MongoDB\BSON\ObjectID Updated/new record id instance.

mongodb\Query $collection

$collection public read-only property Collection instance. public yii\mongodb\Collection getCollection ( $db = null )

mongodb\Migration update()

update() public method Updates the rows, which matches given criteria by given data. Note: for "multiple" mode Mongo requires explicit strategy "$set" or "$inc" to be specified for the "newData". If no strategy is passed "$set" will be used. public integer|boolean update ( $collection, $condition, $newData, $options = [] )$collection array|string Collection name. $condition array Description of the objects to update. $newData array The object with which to update the matching recor

mongodb\Migration init()

init() public method Initializes the migration. This method will set $db to be the 'db' application component, if it is null. public void init ( )

mongodb\Migration insert()

insert() public method Inserts new data into collection. public \MongoDB\BSON\ObjectID insert ( $collection, $data, $options = [] )$collection array|string Collection name. $data array|object Data to be inserted. $options array List of options in format: optionName => optionValue. return \MongoDB\BSON\ObjectID New record id instance.

mongodb\Migration remove()

remove() public method Removes data from the collection. public integer|boolean remove ( $collection, $condition = [], $options = [] )$collection array|string Collection name. $condition array Description of records to remove. $options array List of options in format: optionName => optionValue. return integer|boolean Number of updated documents or whether operation was successful.

mongodb\Migration log()

log() protected method (available since version 2.1.1) Logs the incoming message. By default this method sends message to 'stdout'. protected void log ( $string )$string string Message to be logged.

mongodb\Migration endProfile()

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

mongodb\Migration dropAllIndexes()

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