mongodb\Command $document

$document public property Command document contents. public array $document = []

mongodb\Command $db

$db public property The MongoDB connection that this command is associated with. public yii\mongodb\Connection $db = null

mongodb\Command $databaseName

$databaseName public property Name of the database that this command is associated with. public string $databaseName = null

mongodb\Collection update()

update() public method Updates the rows, which matches given criteria by given data. Note: for "multi" 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 ( $condition, $newData, $options = [] )$condition array Description of the objects to update. $newData array The object with which to update the matching records. $options array List of options in format: optionName =&g

mongodb\Collection save()

save() public method Update the existing database data, otherwise insert this data public \MongoId save ( $data, $options = [] )$data array|object Data to be updated/inserted. $options array List of options in format: optionName => optionValue. return \MongoId Updated/new record id instance. throws yii\mongodb\Exception on failure.

mongodb\Collection remove()

remove() public method Removes data from the collection. public integer|boolean remove ( $condition = [], $options = [] )$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. throws yii\mongodb\Exception on failure.

mongodb\Collection mapReduce()

mapReduce() public method Performs aggregation using MongoDB "map-reduce" mechanism. Note: this function will not return the aggregation result, instead it will write it inside the another Mongo collection specified by "out" parameter. For example: $customerCollection = Yii::$app->mongo->getCollection('customer'); $resultCollectionName = $customerCollection->mapReduce( 'function () {emit(this.status, this.amount)}', 'function (key, values) {return Array.sum(values)}', '

mongodb\Collection listIndexes()

listIndexes() public method (available since version 2.1) Returns the list of defined indexes. public array listIndexes ( $options = [] )$options array List of options in format: optionName => optionValue. return array List of indexes info.

mongodb\Collection insert()

insert() public method Inserts new data into collection. public \MongoDB\BSON\ObjectID insert ( $data, $options = [] )$data array|object Data to be inserted. $options array List of options in format: optionName => optionValue. return \MongoDB\BSON\ObjectID New record ID instance. throws yii\mongodb\Exception on failure.

mongodb\Collection group()

group() public method Performs aggregation using Mongo "group" command. public array group ( $keys, $initial, $reduce, $options = [] )$keys mixed Fields to group by. If an array or non-code object is passed, it will be the key used to group results. If instance of \MongoDB\BSON\Javascript passed, it will be treated as a function that returns the key to group by. $initial array Initial value of the aggregation counter object. $reduce \MongoDB\BSON\Javascript|string Function that take