Mongo Collection
The MongoCollection representation.
Note: Additions to this interface will not be considered to break binary compatibility.
Parameters
The type that this collection will encode documents from and decode documents to.
Functions
Aggregates documents according to the specified aggregation pipeline.
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.
Create an index with the given keys and options.
Create multiple indexes.
Create an Atlas Search index with default
name for the collection.
Create an Atlas Search index for the collection.
Create one or more Atlas Search indexes for the collection.
Removes all documents from the collection that match the given query filter.
Removes at most one document from the collection that matches the given filter.
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
.
Drop an Atlas Search index given its name.
Gets an estimate of the count of documents in a collection using collection metadata.
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.
Get all the Atlas Search 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.
Update an Atlas Search index in the collection.
Creates a change stream for this collection.
Create a new collection instance with a different codec registry.
Create a new collection instance with a different default class to cast any documents returned from the database into.
Create a new collection instance with a different read concern.
Create a new collection instance with a different read preference.
Create a new MongoCollection instance with the set time limit for the full execution of an operation.
Create a new collection instance with a different write concern.
Properties
The codec registry for the collection.
The class of documents stored in this collection.
The read concern for the collection.
the read preference for the collection.
The write concern for the collection.