- Reference >
- JavaScript Methods >
- db.collection.aggregate()
db.collection.aggregate()¶
-
db.collection.aggregate(pipeline)¶ New in version 2.2.
Always call the
db.collection.aggregate()method on a collection object.Arguments: - pipeline – Specifies a sequence of data aggregation processes. See the aggregation reference for documentation of these operators.
Consider the following example from the aggregation documentation.
See also
“
aggregate,” “Aggregation Framework,” and “Aggregation Framework Reference.”