Mongo Collection
The MongoCollection interface.
Note: Additions to this interface will not be considered to break binary compatibility.
Since
3.0
Parameters
Types
Functions
Aggregates documents according to the specified aggregation pipeline. If the pipeline ends with a $out stage, the returned iterable will be a query of the collection that the aggregation was written to. Note that in this case the pipeline will be executed even if the iterable is never iterated.
Executes a mix of inserts, updates, replaces, and deletes.
Counts the number of documents in the collection.
Counts the number of documents in the collection according to the given options.
Creates an index.
Create multiple indexes.
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.
Gets the distinct values of the specified field name.
Drops this collection from the Database.
Drops the index given its name.
Drops the index given the keys used to create it.
Drop all the indexes on this collection, except for the default on _id.
Gets an estimate of the count of documents in a collection using collection metadata.
Finds all documents in the collection.
Atomically find a document and remove it.
Atomically find a document and replace it.
Atomically find a document and update it.
Inserts one or more documents. A call to this method is equivalent to a call to the bulkWrite method
Inserts the provided document. If the document is missing an identifier, the driver should generate one.
Get all the indexes in this collection.
Aggregates documents according to the specified map-reduce function.
Rename the collection with oldCollectionName to the newCollectionName.
Replace a document in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
Update a single document in the collection according to the specified arguments.
Creates a change stream for this collection.
Create a new MongoCollection instance with a different codec registry.
Create a new MongoCollection instance with a different default class to cast any documents returned from the database into..
Create a new MongoCollection instance with a different read concern.
Create a new MongoCollection instance with a different read preference.
Create a new MongoCollection instance with a different write concern.