Aggregates
Saved MongoDB aggregation pipelines that your app runs by id.
Where: Database → Aggregates · /projects/<project>/db/aggregates
An aggregate is a saved MongoDB aggregation pipeline for one collection: it groups, counts, joins and reshapes records. Your app runs it by its id (maggr_…), so you can change the pipeline in Cloud without a new app release.

Columns, search and filters
ID
The aggregate id (maggr_5W9f2eefrp0I3UwXVxDP2o) — the one your app passes to executeAggregate. Click it to open the editor.
Name
The name.
Schema
The collection the pipeline runs on.
The list has no search or filters. Reading needs database:read on the aggregates of a schema (database:aggregate:<schemaId>); creating and changing need database:create / database:update there.
What you can do here
Create an aggregate — Add New: write the pipeline, TEST it on live data, save it.
Edit an aggregate — click the id.
Delete an aggregate — Delete in the editor.
Running an aggregate needs database:read on its collection and on every collection the pipeline joins ($lookup, $graphLookup, $unionWith, also nested and inside $facet). Pipelines are read-only: $out, $merge, $where, $function and $accumulator are refused (CM-ERRORS-DATABASE-031) when you save and every time it runs. A schema that an aggregate starts from or joins cannot be deleted (CM-ERRORS-SCHEMA-018).
Do it from code
Last updated