mongodb\QueryBuilder explain()

explain() public method Generates 'explain' command. public array explain ( $collectionName, $query )$collectionName string Collection name. $query array Query options. return array Command document.

mongodb\QueryBuilder ensureMongoId()

ensureMongoId() protected method Converts given value into \MongoDB\BSON\ObjectID instance. If array given, each element of it will be processed. protected array|\MongoDB\BSON\ObjectID ensureMongoId ( $rawId )$rawId mixed Raw id(s). return array|\MongoDB\BSON\ObjectID Normalized id(s).

mongodb\QueryBuilder dropIndexes()

dropIndexes() public method Generates drop indexes command. public array dropIndexes ( $collectionName, $index )$collectionName string Collection name $index string Index name or pattern, use * in order to drop all indexes. return array Command document.

mongodb\QueryBuilder dropDatabase()

dropDatabase() public method Generates drop database command. https://docs.mongodb.com/manual/reference/method/db.dropDatabase/ public array dropDatabase ( )return array Command document.

mongodb\QueryBuilder dropCollection()

dropCollection() public method Generates drop collection command. https://docs.mongodb.com/manual/reference/method/db.collection.drop/ public array dropCollection ( $collectionName )$collectionName string Name of the collection to be dropped. return array Command document.

mongodb\QueryBuilder distinct()

distinct() public method Generates 'distinct' command. public array distinct ( $collectionName, $fieldName, $condition = [], $options = [] )$collectionName string Collection name. $fieldName string Target field name. $condition array Filter condition $options array List of options in format: optionName => optionValue. return array Command document.

mongodb\QueryBuilder createIndexes()

createIndexes() public method Generates create indexes command. See also https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/. public array createIndexes ( $databaseName, $collectionName, $indexes )$databaseName string|null Database name. $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

mongodb\QueryBuilder createCollection()

createCollection() public method Generates 'create collection' command. https://docs.mongodb.com/manual/reference/method/db.createCollection/ public array createCollection ( $collectionName, array $options = [] )$collectionName string Collection name. $options array Collection options in format: "name" => "value" return array Command document.

mongodb\QueryBuilder count()

count() public method Generates count command public array count ( $collectionName, $condition = [], $options = [] )$collectionName string $condition array $options array return array Command document.

mongodb\QueryBuilder buildSortFields()

buildSortFields() public method Normalizes fields list for the MongoDB sort composition. public array buildSortFields ( $fields )$fields array|string Raw fields. return array Normalized sort fields.