mongodb\Command executeBatch()

executeBatch() public method Execute commands batch (bulk). public array executeBatch ( $collectionName, $options = [] )$collectionName string Collection name. $options array Batch options. return array Array of 2 elements: 'insertedIds' - contains inserted IDs. 'result' - \MongoDB\Driver\WriteResult instance. throws yii\mongodb\Exception on failure. throws yii\base\InvalidConfigException on invalid $document format.

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 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 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 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

mongodb\Command createCollection()

createCollection() public method Creates new collection in database associated with this command.s public boolean createCollection ( $collectionName, array $options = [] )$collectionName string Collection name $options array Collection options in format: "name" => "value" return boolean Whether operation was successful.