Method |
Description |
|
__construct ( MongoDB\Driver\Manager $manager, string $databaseName, string $collectionName, array $options = [] ) |
Constructs new Collection instance. |
|
__debugInfo ( ) : array |
Return internal properties for debugging purposes. |
|
__toString ( ) : string |
Return the collection namespace (e.g. "db.collection"). |
|
aggregate ( array $pipeline, array $options = [] ) : Traversable |
Executes an aggregation framework pipeline on the collection. |
|
bulkWrite ( array $operations, array $options = [] ) : BulkWriteResult |
Executes multiple write operations. |
|
count ( array | object $filter = [], array $options = [] ) : integer |
Gets the number of documents matching the filter. |
|
createIndex ( array | object $key, array $options = [] ) : string |
Create a single index for the collection. |
|
createIndexes ( array $indexes ) : string[] |
Create one or more indexes for the collection. |
|
deleteMany ( array | object $filter, array $options = [] ) : DeleteResult |
Deletes all documents matching the filter. |
|
deleteOne ( array | object $filter, array $options = [] ) : DeleteResult |
Deletes at most one document matching the filter. |
|
distinct ( string $fieldName, array | object $filter = [], array $options = [] ) : mixed[] |
Finds the distinct values for a specified field across the collection. |
|
drop ( array $options = [] ) : array | object |
Drop this collection. |
|
dropIndex ( string $indexName, array $options = [] ) : array | object |
Drop a single index in the collection. |
|
dropIndexes ( array $options = [] ) : array | object |
Drop all indexes in the collection. |
|
find ( array | object $filter = [], array $options = [] ) : MongoDB\Driver\Cursor |
Finds documents matching the query. |
|
findOne ( array | object $filter = [], array $options = [] ) : array | object | null |
Finds a single document matching the query. |
|
findOneAndDelete ( array | object $filter, array $options = [] ) : object | null |
Finds a single document and deletes it, returning the original. |
|
findOneAndReplace ( array | object $filter, array | object $replacement, array $options = [] ) : object | null |
Finds a single document and replaces it, returning either the original or
the replaced document. |
|
findOneAndUpdate ( array | object $filter, array | object $update, array $options = [] ) : object | null |
Finds a single document and updates it, returning either the original or
the updated document. |
|
getCollectionName ( ) : string |
Return the collection name. |
|
getDatabaseName ( ) : string |
Return the database name. |
|
getNamespace ( ) : string |
Return the collection namespace. |
|
insertMany ( array $documents, array $options = [] ) : InsertManyResult |
Inserts multiple documents. |
|
insertOne ( array | object $document, array $options = [] ) : InsertOneResult |
Inserts one document. |
|
listIndexes ( array $options = [] ) : Phalcon\Db\Adapter\MongoDB\Model\IndexInfoIterator |
Returns information for all indexes for the collection. |
|
replaceOne ( array | object $filter, array | object $replacement, array $options = [] ) : UpdateResult |
Replaces at most one document matching the filter. |
|
updateMany ( array | object $filter, array | object $update, array $options = [] ) : UpdateResult |
Updates all documents matching the filter. |
|
updateOne ( array | object $filter, array | object $update, array $options = [] ) : UpdateResult |
Updates at most one document matching the filter. |
|
withOptions ( array $options = [] ) : Collection |
Get a clone of this collection with different options. |
|