Calculates aggregate values for the data in this collection.
Calculates aggregate values for the data in this collection.
A sequence of data aggregation operations or stages.
Specifies to return the information on the processing of the pipeline.
Enables writing to temporary files. When set to true, aggregation operations can write data to the _tmp subdirectory in the dbPath directory.
Specifies the initial batch size for the cursor. The value of the cursor field is a document with the field batchSize.
Counts the number of documents in this collection.
Counts the number of documents in this collection.
A query that selects which documents to count in a collection.
The maximum number of matching documents to return.
The number of matching documents to skip before returning results.
Creates indexes on this collection.
Removes documents from a collection.
Removes documents from a collection.
Specifies deletion criteria using query operators. To delete all documents in a collection, pass an empty document ({}).
To limit the deletion to just one document, set to true. Omit to use the default value of false and delete all documents matching the deletion criteria.
A document expressing the write concern. Omit to use the default write concern.
A WriteResult object that contains the status of the operation.
Finds the distinct values for a specified field across a single collection and returns the results in an array.
Finds the distinct values for a specified field across a single collection and returns the results in an array.
The field for which to return distinct values.
A query that specifies the documents from which to retrieve the distinct values.
Drops this collection
Selects documents in this collection.
Selects documents in this collection.
Specifies selection criteria using query operators. To return all documents in a collection, pass an empty document ({}).
Specifies the fields to return using projection operators. To return all fields in the matching document, omit this parameter.
Removes and returns a single document.
Removes and returns a single document.
The selection criteria for the remove.
Determines which model the operation removes if the query selects multiple models. findAndRemove() removes the first model in the sort order specified by this argument.
A subset of fields to return.
Updates and returns a single document.
Updates and returns a single document. It returns the old document by default.
The selection criteria for the update.
Determines which model the operation updates if the query selects multiple models. findAndUpdate() updates the first model in the sort order specified by this argument.
Performs an update of the selected model.
When true, returns the updated model rather than the original.
A subset of fields to return.
When true, findAndUpdate() creates a new model if no model matches the query.
Retrieves at most one document matching the given selector.
Retrieves a random document matching the given selector.
Returns a list of documents that identify and describe the existing indexes on this collection.
Inserts documents into a collection.
Inserts documents into a collection.
A sequence of documents to insert into the collection.
If true, perform an ordered insert of the documents in the array, and if an error occurs with one of documents, MongoDB will return without processing the remaining documents in the array. If false, perform an unordered insert, and if an error occurs with one of documents, continue processing the remaining documents in the array.
A document expressing the write concern.
Inserts document into this collection.
Inserts document into this collection.
document to insert into the collection.
Inserts document into this collection.
Inserts document into this collection.
document to insert into the collection.
Inserts documents into a collection.
Inserts documents into a collection.
A source of documents to insert into the collection.
If true, perform an ordered insert of the documents in the array, and if an error occurs with one of documents, MongoDB will return without processing the remaining documents in the array. If false, perform an unordered insert, and if an error occurs with one of documents, continue processing the remaining documents in the array.
A document expressing the write concern.
Modifies an existing document or documents in a collection.
Modifies an existing document or documents in a collection. The method can modify specific fields of an existing document or documents or replace an existing document entirely, depending on the update parameter.
The selection criteria for the update. Use the same query selectors as used in the find() method.
The modifications to apply.
If set to true, creates a new document when no document matches the query criteria. The default value is false, which does not insert a new document when no match is found.
If set to true, updates multiple documents that meet the query criteria. If set to false, updates one document. The default value is false.
A document expressing the write concern.
Validates a collection.
Validates a collection. The method scans a collection’s data structures for correctness and returns a single document that describes the relationship between the logical collection and the physical representation of the data.
Specify true to enable a full validation and to return full statistics. MongoDB disables full validation by default because it is a potentially resource-intensive operation.
if false skips the scan of the base collection without skipping the scan of the index.