> For the complete documentation index, see [llms.txt](https://docs.codemash.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codemash.io/cloud/database/aggregates.md).

# Aggregates

An **aggregate** is a saved MongoDB aggregation pipeline you run on demand — to group, count, join, and summarise records without writing that logic into your app.

<figure><img src="/files/w7oa7C5E81fGPUhaMbS7" alt=""><figcaption><p>Database → Aggregates.</p></figcaption></figure>

## What you can do here

The list shows every saved aggregate with its **ID** (`maggr_…`), **Name**, and the **Schema** (collection) it runs on. **Add New** opens the editor — see [Create an aggregate](/cloud/database/aggregates/new.md) for the fields, the sample record panel, and the **TEST** run against live data. Click an aggregate's id to [edit it](/cloud/database/aggregates/edit.md).

Because your app calls an aggregate **by id** (`executeAggregate`), the pipeline stays server-side — you can tune it here without redeploying anything.

## Use it from code

[Database → Aggregates](/sdks-and-cli/database/aggregates.md); run one with `executeAggregate` from the data API.

## API reference

Endpoints: [Database → Aggregates](/api-reference/database/aggregates.md).
