- Companion
- object
Value members
Abstract methods
Aggregates documents according to the specified aggregation pipeline. http://docs.mongodb.org/manual/aggregation/
Aggregates documents according to the specified aggregation pipeline. http://docs.mongodb.org/manual/aggregation/
- Value Params
- pipeline
the aggregate pipeline
Counts the number of documents in the collection according to the given options.
Counts the number of documents in the collection according to the given options.
- Value Params
- filter
the query filter
- options
the options describing the count
- Since
2.4
- Value Params
- key
an object describing the index key(s). This can be of any type for which a
Codec
is registered- options
the options for the index
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
- Value Params
- filter
the query filter to apply the the delete operation
- options
the options to apply to the delete operation @since 1.2
Removes at most one document from the collection that matches the given 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.
- Value Params
- filter
the query filter to apply the the delete operation
- options
the options to apply to the delete operation @since 1.2
Gets the distinct values of the specified field name.
Gets the distinct values of the specified field name.
- Value Params
- fieldName
the field name
- filter
the query filter
Drops the given index.
Drops the given index.
http://docs.mongodb.org/manual/reference/command/dropIndexes/
- Value Params
- name
the name of the index to remove
- options
options to use when dropping indexes
Drops the index given the keys used to create it.
Drops the index given the keys used to create it.
- Value Params
- keys
the keys of the index to remove
- options
options to use when dropping indexes
- Since
2.2
Drop all the indexes on this collection, except for the default on _id.
Drop all the indexes on this collection, except for the default on _id.
http://docs.mongodb.org/manual/reference/command/dropIndexes/
- Value Params
- options
options to use when dropping indexes
- Since
2.2
Finds matching documents in the collection.
Finds matching documents in the collection.
- Value Params
- filter
the query filter
Atomically find a document and remove it.
Atomically find a document and remove it.
- Value Params
- filter
the query filter to find the document with
- options
the options to apply to the operation
- Note
If no documents matched the query filter, then None will be returned
Atomically find a document and replace it.
Atomically find a document and replace it.
- Value Params
- filter
the query filter to apply the the replace operation
- options
the options to apply to the operation
- replacement
the replacement document
- Note
Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then None will be returned
Atomically find a document and update it.
Atomically find a document and update it.
- Value Params
- filter
a document describing the query filter. This can be of any type for which a
Codec
is registered- options
the options to apply to the operation
- update
a document describing the update. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered
- Note
Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then None will be returned
Inserts a batch of documents. The preferred way to perform bulk inserts is to use the BulkWrite API. However, when talking with a server < 2.6, using this method will be faster due to constraints in the bulk API related to error handling.
Inserts a batch of documents. The preferred way to perform bulk inserts is to use the BulkWrite API. However, when talking with a server < 2.6, using this method will be faster due to constraints in the bulk API related to error handling.
- Value Params
- documents
the documents to insert
- options
the options to apply to the operation
Inserts the provided document. If the document is missing an identifier, the driver should generate one.
Inserts the provided document. If the document is missing an identifier, the driver should generate one.
- Value Params
- document
the document to insert
- options
the options to apply to the operation @since 1.1
Replace a document in the collection according to the specified arguments.
Replace a document in the collection according to the specified arguments.
http://docs.mongodb.org/manual/tutorial/modify-documents/#replace-the-document
- Value Params
- filter
the query filter to apply the the replace operation
- options
the options to apply to the replace operation
- replacement
the replacement document
Update all documents in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
http://docs.mongodb.org/manual/tutorial/modify-documents/ http://docs.mongodb.org/manual/reference/operator/update/
- Value Params
- filter
a document describing the query filter. This can be of any type for which a
Codec
is registered- options
the options to apply to the update operation
- update
a document describing the update. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered
Update all documents in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
http://docs.mongodb.org/manual/tutorial/modify-documents/ http://docs.mongodb.org/manual/reference/operator/update/
- Value Params
- filter
a document describing the query filter. This can be of any type for which a
Codec
is registered- options
the options to apply to the update operation
- update
a pipeline describing the update.
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
Update a single document in the collection according to the specified arguments.
Update a single document in the collection according to the specified arguments.
http://docs.mongodb.org/manual/tutorial/modify-documents/ http://docs.mongodb.org/manual/reference/operator/update/
- Value Params
- filter
a document describing the query filter. This can be of any type for which a
Codec
is registered- options
the options to apply to the update operation
- update
a document describing the update. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered
Update a single document in the collection according to the specified arguments.
Update a single document in the collection according to the specified arguments.
http://docs.mongodb.org/manual/tutorial/modify-documents/ http://docs.mongodb.org/manual/reference/operator/update/
- Value Params
- filter
a document describing the query filter. This can be of any type for which a
Codec
is registered- options
the options to apply to the update operation
- update
a pipeline describing the update.
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
Concrete methods
Counts the number of documents in the collection.
Counts the number of documents in the collection.
- Since
2.4
Gets the distinct values of the specified field name.
Gets the distinct values of the specified field name.
http://docs.mongodb.org/manual/reference/command/distinct/Distinct
- Value Params
- fieldName
the field name
Creates a change stream for this collection.
Creates a change stream for this collection.
- Since
2.2
- Note
Requires MongoDB 3.6 or greater