Since MongoDB 3.4
Since MongoDB 3.4
https://docs.mongodb.com/manual/reference/operator/aggregation/addFields/
Ascending sort order
Since MongoDB 3.4 Categorizes incoming documents into a specific number of groups, called buckets, based on a specified expression.
Since MongoDB 3.4
Categorizes incoming documents into a specific number of groups, called buckets,
based on a specified expression. Bucket boundaries are automatically determined
in an attempt to evenly distribute the documents into the specified number of buckets.
Document fields identifier must be prefixed with $
.
https://docs.mongodb.com/manual/reference/operator/aggregation/bucketAuto/
Low level pipeline operator which allows to open a tailable cursor against subsequent ChangeEvents of a given collection (since MongoDB 3.6).
Low level pipeline operator which allows to open a tailable cursor against subsequent ChangeEvents of a given collection (since MongoDB 3.6). https://docs.mongodb.com/manual/reference/change-events/
For common use-cases, you might prefer to use the watch
operator on a collection.
Note: the target mongo instance MUST be a replica-set (even in the case of a single node deployement).
_Since MongoDB 3.4:_ Counts of the number of documents input.
_Since MongoDB 3.4:_ Counts of the number of documents input. https://docs.mongodb.com/manual/reference/operator/aggregation/count/
the name of the output field which has the count as its value
Descending sort order
The $filter aggregation stage.
The $filter aggregation stage.
the expression that resolves to an array
The variable name for the element in the input array. The as expression accesses each element in the input array by this variable.
the expression that determines whether to include the element in the resulting array
Outputs documents in order of nearest to farthest from a specified point.
Outputs documents in order of nearest to farthest from a specified point.
http://docs.mongodb.org/manual/reference/operator/aggregation/geoNear/#pipe._S_geoNear
_Since MongoDB 3.4:_ The $graphLookup aggregation stage.
_Since MongoDB 3.4:_ The $graphLookup aggregation stage.
the target collection for the $graphLookup operation to search
the expression that specifies the value of the connectFromField
with which to start the recursive search
the field name whose value $graphLookup
uses to recursively match against the connectToField
of other documents in the collection
the field name in other documents against which to match the value of the field specified by the connectFromField
parameter
the name of the array field added to each output document
an optional non-negative integral number specifying the maximum recursion depth
an optional name for a field to add to each traversed document in the search path
an optional filter expression
Groups documents together to calculate aggregates on document collections.
Groups documents together to calculate aggregates on document collections.
This command aggregates on arbitrary identifiers.
Document fields identifier must be prefixed with $
.
http://docs.mongodb.org/manual/reference/aggregation/group/#_S_group
any BSON value acceptable by mongodb as identifier
the sequence of operators specifying aggregate calculation
Groups documents together to calculate aggregates on document collections.
Groups documents together to calculate aggregates on document collections. This command aggregates on one field. http://docs.mongodb.org/manual/reference/aggregation/group/#_S_group
the name of the field to aggregate on
the sequence of operators specifying aggregate calculation
Represents one of the group/accumulator operators,
for the $group
aggregation.
Represents one of the group/accumulator operators,
for the $group
aggregation. Operation.
https://docs.mongodb.com/manual/reference/operator/aggregation/group/#accumulator-operator
Groups documents together to calculate aggregates on document collections.
Groups documents together to calculate aggregates on document collections. This command aggregates on multiple fields, and they must be named. http://docs.mongodb.org/manual/reference/aggregation/group/#_S_group
The fields to aggregate on, and the names they should be aggregated under.
the sequence of operators specifying aggregate calculation
the number of operations that used the index
the time from which MongoDB gathered the statistics
the index name
the key specification
the hostname and port of the mongod
the index statistics
Limits the number of documents that pass through the stream.
Limits the number of documents that pass through the stream. http://docs.mongodb.org/manual/reference/aggregation/limit/#_S_limit
the number of documents to allow through
_Since MongoDB 3.2:_ Performs a left outer join to an unsharded collection in the same database to filter in documents from the "joined" collection for processing.
_Since MongoDB 3.2:_ Performs a left outer join to an unsharded collection in the same database to filter in documents from the "joined" collection for processing. https://docs.mongodb.com/v3.2/reference/operator/aggregation/lookup/#pipe._S_lookup
the collection to perform the join with
the field from the documents input
the field from the documents in the from
collection
the name of the new array field to add to the input documents
Filters out documents from the stream that do not match the predicate.
Filters out documents from the stream that do not match the predicate. http://docs.mongodb.org/manual/reference/aggregation/match/#_S_match
the query that documents must satisfy to be in the stream
Metadata sort order.
Metadata sort order.
the metadata keyword to sort by
Takes the documents returned by the aggregation pipeline and writes them to a specified collection http://docs.mongodb.org/manual/reference/operator/aggregation/out/#pipe._S_out
Takes the documents returned by the aggregation pipeline and writes them to a specified collection http://docs.mongodb.org/manual/reference/operator/aggregation/out/#pipe._S_out
the name of the output collection
One of MongoDBs pipeline operators for aggregation.
One of MongoDBs pipeline operators for aggregation. Sealed as these are defined in the MongoDB specifications, and clients should not have custom operators.
Reshapes a document stream by renaming, adding, or removing fields.
Reshapes a document stream by renaming, adding, or removing fields. Also uses Project to create computed values or sub-objects.
The fields to include. The resulting objects will contain only these fields.
Restricts the contents of the documents based on information stored in the documents themselves.
Restricts the contents of the documents based on information stored in the documents themselves. http://docs.mongodb.org/manual/reference/operator/aggregation/redact/#pipe._S_redact Redact
the redact expression
Promotes a specified document to the top level and replaces all other fields.
Promotes a specified document to the top level and replaces all other fields. The operation replaces all existing fields in the input document, including the _id field. https://docs.mongodb.com/manual/reference/operator/aggregation/replaceRoot
The new root object
Promotes a specified document to the top level and replaces all other fields.
Promotes a specified document to the top level and replaces all other fields. The operation replaces all existing fields in the input document, including the _id field. https://docs.mongodb.com/manual/reference/operator/aggregation/replaceRoot
The field name to become the new root
Randomly selects the specified number of documents from its input.
Randomly selects the specified number of documents from its input. https://docs.mongodb.org/master/reference/operator/aggregation/sample/
the number of documents to return
Skips over a number of documents before passing all further documents along the stream.
Skips over a number of documents before passing all further documents along the stream. http://docs.mongodb.org/manual/reference/aggregation/skip/#_S_skip
the number of documents to skip
Returns a subset of an array.
Returns a subset of an array. https://docs.mongodb.com/manual/reference/operator/aggregation/slice/
Sorts the stream based on the given fields.
Sorts the stream based on the given fields. http://docs.mongodb.org/manual/reference/aggregation/sort/#_S_sort
the fields to sort by
Represents that a field should be sorted on, as well as whether it should be ascending or descending.
The $stdDevPop group accumulator (since MongoDB 3.2)
The $stdDevPop group accumulator (since MongoDB 3.2)
The $stdDevPop for a single field (since MongoDB 3.2)
The $stdDevPop for a single field (since MongoDB 3.2)
The $stdDevSamp group accumulator (since MongoDB 3.2)
The $stdDevSamp group accumulator (since MongoDB 3.2)
The $stdDevSamp for a single field (since MongoDB 3.2)
The $stdDevSamp for a single field (since MongoDB 3.2)
Turns a document with an array into multiple documents, one document for each element in the array.
Turns a document with an array into multiple documents, one document for each element in the array. http://docs.mongodb.org/manual/reference/aggregation/unwind/#_S_unwind
the name of the array to unwind
the sequence of MongoDB aggregation operations
specifies to return the information on the processing of the pipeline
enables writing to temporary files
the cursor object for aggregation
available only if you specify the $out aggregation operator
the read concern (since MongoDB 3.2)
(Since version 0.12.7) Use api.collections.Aggregator
the documents of the first batch
the cursor from the result, if any
(Since version 0.12.7) Use api.collections.Aggregator
the initial batch size for the cursor
(Since version 0.12.7) Use api.collections.Aggregator
(Since version 0.12.0) Use SumAll
Filter companion
Factory to declare custom call to a group function.
Factory to declare custom call to a group function.
Since MongoDB 3.2 https://docs.mongodb.com/manual/reference/operator/aggregation/indexStats/
Only for advanced user: Factory for stage not already provided in the API.
Only for advanced user: Factory for stage not already provided in the API.
For example for { $sample: { size: 2 } }
PipelineOperator(BSONDocument("$sample" -> BSONDocument("size" -> 2)))
Project(BSONDocument( "name" -> 1, "favorites" -> Slice( array = BSONString(f"$$favorites"), n = BSONInteger(3)).makePipe))
Sum operation of the form $sum: 1
Sum operation of the form $sum: 1
References the score associated with the corresponding $text
query for each matching document.
Implements the Aggregation Framework.
PipelineOperator