SQL Reference
AGGREGATE
aggregate(list, function_name, …)
Section titled “aggregate(list, function_name, …)”- list: ANY[]
- function_name: VARCHAR
Example
Section titled “Example”SELECT aggregate([1, 2, NULL], 'min');db.collection.aggregate(pipeline, options)
Section titled “db.collection.aggregate(pipeline, options)”- pipeline: An array of aggregation stages such as $match, $group, and $sort.
- options: Optional settings such as allowDiskUse and maxTimeMS.
Example
Section titled “Example”db.orders.aggregate([ { $match: { status: "shipped" } }, { $group: { _id: "$customerId", total: { $sum: "$amount" } } }])