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