mongodb\Command findAndModify()

findAndModify() public method Updates a document and returns it. public array|null findAndModify ( $collectionName, $condition = [], $update = [], $options = [] )$collectionName $condition array Query condition $update array Update criteria $options array List of options in format: optionName => optionValue. return array|null The original document, or the modified document when $options['new'] is set.

mongodb\Command execute()

execute() public method Executes this command. public \MongoDB\Driver\Cursor execute ( )return \MongoDB\Driver\Cursor Result cursor. throws yii\mongodb\Exception on failure.

mongodb\Command endProfile()

endProfile() protected method Marks the end of a code block for profiling. See also beginProfile(). protected void endProfile ( $token, $category )$token string Token for the code block $category string The category of this log message

mongodb\Command dropIndexes()

dropIndexes() public method Drops collection indexes by name. public array dropIndexes ( $collectionName, $indexes )$collectionName string Collection name. $indexes string Wildcard for name of the indexes to be dropped. return array Result data.

mongodb\Command dropDatabase()

dropDatabase() public method Drops database associated with this command. public boolean dropDatabase ( )return boolean Whether operation was successful.

mongodb\Command delete()

delete() public method Removes documents from the collection. public \MongoDB\Driver\WriteResult delete ( $collectionName, $condition, $options = [] )$collectionName string Collection name. $condition array Filter condition. $options array Delete options. return \MongoDB\Driver\WriteResult Write result.

mongodb\Command dropCollection()

dropCollection() public method Drops specified collection. public boolean dropCollection ( $collectionName )$collectionName string Name of the collection to be dropped. return boolean Whether operation was successful.

mongodb\Command distinct()

distinct() public method Returns a list of distinct values for the given column across a collection. public array distinct ( $collectionName, $fieldName, $condition = [], $options = [] )$collectionName string Collection name. $fieldName string Field name to use. $condition array Query parameters. $options array List of options in format: optionName => optionValue. return array Array of distinct values, or "false" on failure.

mongodb\Command count()

count() public method Counts records in specified collection. public integer count ( $collectionName, $condition = [], $options = [] )$collectionName string Collection name $condition array Filter condition $options array List of options in format: optionName => optionValue. return integer Records count

mongodb\Command createIndexes()

createIndexes() public method Creates indexes in the collection. public boolean createIndexes ( $collectionName, $indexes )$collectionName string Collection name. $indexes array[] Indexes specification. Each specification should be an array in format: optionName => value The main options are: keys: array, column names with sort order, to be indexed. This option is mandatory. unique: boolean, whether to create unique index. name: string, the name of the index, if not set it will be