mongodb\Command group()

group() public method Performs aggregation using MongoDB "group" command. public array group ( $collectionName, $keys, $initial, $reduce, $options = [] )$collectionName string Collection name. $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.

mongodb\Command listCollections()

listCollections() public method Returns the list of available collections. public array listCollections ( $condition = [], $options = [] )$condition array Filter condition. $options array Options list. return array Collections information.

mongodb\Command insert()

insert() public method Inserts new document into collection. public \MongoDB\BSON\ObjectID|boolean insert ( $collectionName, $document, $options = [] )$collectionName string Collection name $document array Document content $options array List of options in format: optionName => optionValue. return \MongoDB\BSON\ObjectID|boolean Inserted record ID, false - on failure.

mongodb\Command listDatabases()

listDatabases() public method Returns the list of available databases. public array listDatabases ( $condition = [], $options = [] )$condition array Filter condition. $options array Options list. return array Database information

mongodb\Command getReadConcern()

getReadConcern() public method Retuns read concern for this command. public \MongoDB\Driver\ReadConcern|string getReadConcern ( )return \MongoDB\Driver\ReadConcern|string Read concern to be used in this command.

mongodb\Command getWriteConcern()

getWriteConcern() public method Returns write concern for this command. public \MongoDB\Driver\WriteConcern|null getWriteConcern ( )return \MongoDB\Driver\WriteConcern|null Write concern to be used in this command.

mongodb\Command getReadPreference()

getReadPreference() public method Returns read preference for this command. public \MongoDB\Driver\ReadPreference getReadPreference ( )return \MongoDB\Driver\ReadPreference Read preference.

mongodb\Command explain()

explain() public method Return an explanation of the query, often useful for optimization and debugging. public array explain ( $collectionName, $query )$collectionName string Collection name $query array Query document. return array Explanation of the query.

mongodb\Command find()

find() public method Performs find query. public \MongoDB\Driver\Cursor find ( $collectionName, $condition, $options = [] )$collectionName string Collection name $condition array Filter condition $options array Query options. return \MongoDB\Driver\Cursor Result cursor.

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.