<!-- llms-explorer concept facts · https://llms-explorer.com/tree/aggregation-pipeline-in-charts/ · pack 2026-10-02 · ~11757 tokens -->

# Aggregation Pipeline in Charts

> Depth-first rabbithole dossier for Aggregation Pipeline in Charts; source-anchored research pack.

Parent: [MongoDB Atlas Charts](https://llms-explorer.com/tree/mongodb-atlas-charts/) · 6 facets · 66 facts · page: https://llms-explorer.com/tree/aggregation-pipeline-in-charts/

## Definitions

- - Charts Embedding SDK filter model, which is a sibling concept. - Charts Lookup Fields and Calculated Fields, which are sibling concepts. - Atlas Search inside Charts (`$search`/`$searchMeta`), an adjacent concept. — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/history.md#handoffs-not-researched-here`

## How it works

- - **PC1. `$lookup` in a chart.** The parent says you can join collections "inside a chart using `$lookup` in a custom aggregation pipeline". The query bar rejects `$lookup`. The docs say: "Charts doesn't support the `$lookup` operator in aggregation queries. However, you can use this operator in Data Source pipelines." The supported routes are a Charts view or a Lookup Field. — S2, S23, S20 v1.22.0 - **PC2. Query bar as the first stage.** The parent says the query-bar filter is "equivalent to the first stage in a pipeline". The query bar is segment 4. Charts views, embedding pre-filters and da — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#corrections-to-the-inherited-parent-facts-4-4-reports-agree`
- - C1. The parent says you can join collections "inside a chart using `$lookup` in a custom aggregation pipeline". The query bar rejects `$lookup` (claims 11 and 32). A join must be a charts view (Project Owner only) or a Lookup Field. - C2. The parent says a query-bar filter "is applied as a `$match` stage before any aggregation… equivalent to the first stage in a pipeline". It is not the first stage. Charts views, embedding pre-filters and dashboard filters all run before it (claim 2). It is first only when none of those are configured. — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/history.md#corrections-to-inherited-parent-facts`
- - **C1. The parent says you can join collections "inside a chart using `$lookup` in a custom aggregation pipeline". That is wrong for the chart query bar.** The docs say: "Charts doesn't support the `$lookup` operator in aggregation queries. However, you can use this operator in Data Source pipelines." — https://www.mongodb.com/docs/charts/aggregation-pipeline/ . To join inside a chart, use a lookup field (C-L1) or a Charts view. Charts v1.22.0 (2021-02-18) "Improves messages when `$lookup` is used in the query bar" — https://www.mongodb.com/docs/charts/release-notes/ - **C2. The parent says t — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/mechanism.md#corrections-to-inherited-parent-facts`
- - https://www.mongodb.com/docs/charts/aggregation-pipeline-generation/ - https://www.mongodb.com/docs/charts/aggregation-pipeline/ - https://www.mongodb.com/docs/charts/filter-chart-results/ - https://www.mongodb.com/docs/charts/view-export-chart-data/ - https://www.mongodb.com/docs/charts/create-manage-charts-view/ - https://www.mongodb.com/docs/charts/filter-embedded-charts/ - https://www.mongodb.com/docs/charts/release-notes/ - https://www.mongodb.com/community/forums/t/how-to-make-lookup-aggregation-work-in-charts/281609 - https://www.mongodb.com/community/forums/t/how-to-pass-aggregate-qu — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/history.md#sources`

## Measurements and reference values

- - C-V1. A Charts view is a data source that applies an aggregation pipeline to a collection to pre-process its data before Charts uses it. You can create more than one view from the same collection — https://www.mongodb.com/docs/charts/create-manage-charts-view/ - C-V2. Only a Project Owner can create, modify, or permanently delete a Charts view — https://www.mongodb.com/docs/charts/create-manage-charts-view/ - C-V3. A view pipeline must be an array of stage objects — https://www.mongodb.com/docs/charts/create-manage-charts-view/ - C-V4. The documented uses are joining collections with `$looku — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/mechanism.md#c-charts-views-data-source-pipelines-segment-1`
- - C1. A Charts view is a data source that pre-processes a collection with a pipeline. One collection can have several views. [M,H,P] — S4, S5 - C2. Only a Project Owner can create, modify or delete a view. [M,H,E,P] — S4, S5 - C3. A view pipeline must be an array of stage objects. [M] — S4 - C4. The documented uses are `$lookup` joins, hiding fields with `$project`, and type conversion. [M] gives `$addFields` as the conversion example; [P] gives `$toDate`. — S4, S5 - C5. Data-source pipelines that support `$lookup` arrived in v1.6.0 (2019-09-03). In-builder testing of view pipelines arrived in — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#c-charts-views-segment-1`
- - **Sources:** 3 independent origins. Primary: official MongoDB Charts docs and release notes (www.mongodb.com/docs). Secondary: MongoDB staff answers on the community forum (www.mongodb.com/community). Disconfirming third party: oneuptime.com. **The gate is only partly met.** The origins span just 2 distinct hosts, and the forum is run by MongoDB. Firecrawl, Bash/curl, and GitHub raw access were denied in this session, so no second non-vendor host could be reached. - **Passes:** pass 0 = 13 claims. Pass 1 = +22 (rate 63%). Pass 2 = +11 (24%). Pass 3 = +4 (8%). The rate never fell below 5% on — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/mechanism.md#quality-gate-and-saturation`
- | Pass | Focus | New claims | New / total | |---|---|---|---| | 0 | Backing-pipeline order, query-bar restrictions, document limits | 19 | 19 / 19 = 100% | | 1 | Forum staff answers on timeouts, `$lookup`, and embedding order | 11 | 11 / 30 ≈ 37% | | 2 | Release-note history, server aggregation limits, third-party workaround | 7 | 7 / 37 ≈ 19% | — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/edge-cases.md#saturation`
- - Hosts used: mongodb.com (docs, release notes, community forum), github.com (mongodb-js SDK releases and issue), oneuptime.com (third-party blog), studio3t.com (third-party; checked, no relevant pipeline claims). - The three-host gate is met nominally. In substance, independence is weak. Every authoritative fact traces back to MongoDB: the docs, MongoDB staff on the forum, and MongoDB's own SDK repo. The only fully independent source (oneuptime) is secondary and partly contradicts the docs (D1). - Disconfirming search: done. It surfaced D1 and the corrections C1 and C2 to the parent facts. - — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/history.md#quality-gate`
- | Pass | Focus | New claims | Total | New-info rate | |---|---|---|---|---| | 0 | Pipeline order, query bar, generated stages | 15 | 15 | 100% | | 1 | Views, lookup fields, limits, release dates | 9 | 24 | 38% | | 2 | Embedding filter placement, sampling, timeout, caching | 14 | 38 | 37% | | 3 | Independent and disconfirming sources | 2 | 40 | 5% | — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/practice.md#depth-pass-record`

## Problems, failure modes and limitations

- - A1. Charts builds one aggregation pipeline per chart and runs it on the database server. [M,H,E,P] — S1 - A2. The pipeline has 11 segments in a fixed order: (1) Charts views, (2) embedding pre-filters, (3) dashboard filters, (4) chart query (the query bar), (5) lookup fields, (6) calculated fields, (7) embedding filters, including injected filters, (8) chart filters (Filter pane), (9) encoded fields, (10) sorting, (11) maximum document limit. [M,H,E,P] — S1 - A3. Charts leaves out any segment the author did not configure. [M,H,E,P] — S1 - A4. The author can configure some segments but not al — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#a-structure-of-the-backing-pipeline`
- - D1. A lookup field produces a `$lookup` stage. It arrived in v1.19.0 (2020-10-13). [all] — S6, S20 - D2. The remote collection must already be a Charts data source in the same database. The local collection itself may be the remote (a self-join). [M,E,P] — S6 - D3. If the remote collection has no matching document, the lookup field is empty. [M] — S6 - D4. A lookup field returns either all matches or only the first. MongoDB recommends "all" for one-to-many joins and "first" for one-to-one or many-to-one joins. [M,P] — S6 - D5. A lookup on an unindexed field in a large collection "can cause s — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#d-lookup-fields-segment-5-and-calculated-fields-segment-6`
- - E1. Dashboard filters do not support lookup fields, calculated fields or missing fields. The documented workaround is to put the field in a Charts view, which moves it to segment 1. [M,E] — S9 - E2. *Inference:* dashboard filters can filter only on source fields, not on fields the query bar creates. This fits the segment order (3 runs before 4, 5 and 6). [M,E] — S1, S9 - E3. Dashboard filtering arrived in v1.10.0 (2020-02-05). v1.11.0 (2020-03-02) extended it to public link-shared dashboards. [H] — S20 - E4. The first embedding filters arrived in v1.5.0 (2019-08-07) and required Verified Sig — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#e-dashboard-filters-segment-3-and-embedding-filters-segments-2-and-7`
- - G1. Staff (2021): chart queries time out after 90 s, and removing the timeout would be "a fairly significant architectural change". [E,P] — S25 - G2. v1.39.0 (2023-08-22) made the timeout raisable to 10 minutes "for experimentation", by request to MongoDB Support. It is opt-in, not the default. [M,E,P] — S20 - G3. Staff list four causes of slow chart queries: a query-bar entry, a data-source pipeline, a MongoDB View as the source, and a Lookup Field. [E,P] — S25 - G4. Field sampling reads a random 50 documents from the first 10,000 (staff, 2021-05-19). If any of the four causes in G3 is pres — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#g-timeouts-sampling-caching-performance`
- 1. **`$lookup` in a chart pipeline.** - Parent fact and OneUptime (S30): describe an "Aggregation Pipeline toggle" on the data source and show a working `$lookup`. - Official docs and staff (S2, S23): the query bar rejects `$lookup`. The docs never mention a toggle. - Reading: OneUptime probably merges the Charts-view route with the query bar. 2. **Can a chart combine collections?** - Knowi, a competing vendor (S34): a chart shows "a single collection or view at a time". - MongoDB (S6): Lookup Fields join collections inside the chart builder. - Knowi is right that a join cannot cross databases — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#disagreements-kept-side-by-side`
- 12. **Disconfirms the parent fact.** The parent says multiple collections can be joined "inside a chart using `$lookup` in a custom aggregation pipeline". The docs say: "Charts doesn't support the `$lookup` operator in aggregation queries. However, you can use this operator in Data Source pipelines." https://www.mongodb.com/docs/charts/aggregation-pipeline/ 13. MongoDB staff confirmed in May 2024 that `$lookup` cannot be typed into the query bar. The two routes are the Lookup Field UI and a Charts view. https://www.mongodb.com/community/forums/t/how-to-make-lookup-aggregation-work-in-charts/28 — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/edge-cases.md#restrictions-on-the-query-bar-pipeline`
- 24. The final segment is a server-side `$limit`. Once the limit is reached, "there is no way to determine which documents from the total data set comprise the chart data". Charts shows a warning with the limit for that chart type. https://www.mongodb.com/docs/charts/chart-types/ 25. The limit depends on the chart type: 5000 documents for column and bar charts, and 50000 documents for scatter charts. https://www.mongodb.com/docs/charts/chart-type-reference/column-bar-chart/ ; https://www.mongodb.com/docs/charts/chart-type-reference/scatter-chart/ 26. The backing-pipeline page shows `{ "$limit": — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/edge-cases.md#output-limits`
- 30. In 2021, MongoDB staff stated a 90-second chart query timeout. They described removing it as "a fairly significant architectural change". https://www.mongodb.com/community/forums/t/chart-gets-a-timeout-how-to-debug/106781 31. The same staff answer gives four triggers for a slow chart query: a query in the query bar, a pipeline on the data source, a data source that points to a View, and a Lookup Field. https://www.mongodb.com/community/forums/t/chart-gets-a-timeout-how-to-debug/106781 32. A chart with no filter, or with a filter on an unindexed field, scans every document, even for a simpl — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/edge-cases.md#timeouts-and-performance`
- 1. Atlas Charts renders every chart by building a MongoDB aggregation pipeline whose stages come from the chart author's settings. — https://www.mongodb.com/docs/charts/aggregation-pipeline-generation/ 2. The backing pipeline has 11 segments in this fixed order: (1) charts views, (2) pre-filters in embedding charts, (3) dashboard filters, (4) chart query, (5) lookup fields, (6) calculated fields, (7) embedding filters including injected filters, (8) chart filters (Filter pane), (9) encoded fields, (10) sorting, (11) maximum document limit. — https://www.mongodb.com/docs/charts/aggregation-pipe — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/history.md#mechanism-current-state`
- 9. The query bar accepts either a filter document in curly brackets (`find()` query syntax) or an aggregation pipeline. — https://www.mongodb.com/docs/charts/filter-chart-results/ 10. A pipeline in the query bar must be wrapped in square brackets. — https://www.mongodb.com/docs/charts/aggregation-pipeline/ 11. Charts does not accept `$lookup` in the query bar. Joins must go in a charts view (data source pipeline) or use the Lookup Field feature. — https://www.mongodb.com/docs/charts/aggregation-pipeline/ ; https://www.mongodb.com/community/forums/t/how-to-make-lookup-aggregation-work-in-charts — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/history.md#query-bar-segment-4`
- 18. An embedding `filter` (SDK option or iframe URL parameter) must be a `$match`-style query: top-level conditions or `$and`/`$or`/`$nor`. Other pipeline stages are not allowed. — https://www.mongodb.com/docs/charts/filter-embedded-charts/ 19. A viewer can filter only on fields the author listed in "Allowed filter fields". The default list is empty. — https://www.mongodb.com/docs/charts/filter-embedded-charts/ 20. A `preFilter` runs after charts views and before the chart query and chart filters. — https://www.mongodb.com/docs/charts/filter-embedded-charts/ 21. In 2021 a Charts team member sa — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/history.md#embedding-injection-points-segments-2-and-7`
- 24. Charts v1.0.0 shipped on 2018-12-11. This is the earliest version in the current release notes. — https://www.mongodb.com/docs/charts/release-notes/ 25. v1.3.0 (2019-05-14): "Improved Query Bar in the chart builder, allowing the chart author to specify custom aggregation pipeline stages." This is the first release note that mentions author-written pipeline stages. Before it, the query bar was presumably filter-only, but no source states this directly. — https://www.mongodb.com/docs/charts/release-notes/ 26. v1.5.0 (2019-08-07): custom filters in embedded charts using Verified Signature aut — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/history.md#history-dated-from-the-official-release-notes-unless-noted`
- **In scope:** how Atlas Charts builds and runs the aggregation pipeline behind every chart: the order of its segments, the stages each authoring surface adds (query bar, lookup fields, calculated fields, encodings, sorting, limit, embedding filters), syntax rules, operator restrictions, limits, and how to inspect the pipeline. **Out of scope:** chart types, dashboard layout, embedding SDK authentication, the Charts REST API, cost, and the general MongoDB aggregation framework. Those are separate frontier items. — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/mechanism.md#scope`
- - A1. To get the data for a chart, Charts builds one MongoDB aggregation pipeline and runs it on the database server — https://www.mongodb.com/docs/charts/aggregation-pipeline-generation/ - A2. The pipeline segments run in this fixed order: (1) Charts views, (2) pre-filters in embedded charts, (3) dashboard filters, (4) chart query, (5) lookup fields, (6) calculated fields, (7) embedding filters, including injected filters, (8) chart filters, (9) encoded fields, (10) sorting, (11) maximum document limit — https://www.mongodb.com/docs/charts/aggregation-pipeline-generation/ - A3. Charts skips a — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/mechanism.md#a-backing-pipeline-structure`
- - B1. The query bar accepts a filter document with the same syntax as the query part of `db.collection.find()`. A filter document must be in curly brackets — https://www.mongodb.com/docs/charts/filter-chart-results/ - B2. The query bar also accepts an aggregation pipeline. A pipeline must be in square brackets — https://www.mongodb.com/docs/charts/aggregation-pipeline/ - B3. The query bar supports more complex queries than the Filter tab. The Filter tab cannot use the same field in more than one filter — https://www.mongodb.com/docs/charts/filter-chart-results/ - B4. The query bar does not sup — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/mechanism.md#b-chart-query-query-bar-segment-4`
- 1. **Where custom pipelines go, and whether `$lookup` is allowed.** A third-party guide (oneuptime.com, 2026-03-31) describes an "Aggregation Pipeline" toggle in the data source panel and gives a `$lookup` join example. It never mentions any `$lookup` restriction — https://oneuptime.com/blog/post/2026-03-31-mongodb-how-to-use-custom-aggregation-pipelines-with-atlas-charts/view . The official docs allow `$lookup` only in data source pipelines (Charts views) and reject it in the chart query bar — https://www.mongodb.com/docs/charts/aggregation-pipeline/ . The two can be reconciled only if the gu — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/mechanism.md#unresolved-disagreements`
- In scope: the aggregation pipeline that Atlas Charts builds and runs for each chart. That covers how Charts orders the pipeline, the custom pipeline you enter in the query bar, the pipelines that Charts views, lookup fields, calculated fields and embedding filters add, the server-side `$limit`, timeouts, caching, how to inspect the pipeline, and what all of this means in operation. Out of scope: chart types, dashboard layout, the embedding SDK and JWT setup beyond where filters land in the pipeline, the Charts REST API, billing, Data Federation, and general MQL. — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/practice.md#scope`
- 1. Charts builds every chart's backing pipeline from 11 segments, in this order: Charts views, embedding pre-filters, dashboard filters, chart query (query bar), lookup fields, calculated fields, embedding filters (including injected filters), chart filters, encoded fields, sorting, and the maximum document limit. — https://www.mongodb.com/docs/charts/aggregation-pipeline-generation/ 2. If a segment is not specified, Charts leaves it out. A chart author can configure some of the segments but not all of them. — https://www.mongodb.com/docs/charts/aggregation-pipeline-generation/ 3. Encoding a c — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/practice.md#pipeline-construction-and-order`
- 10. The query bar accepts either a filter document or an aggregation pipeline. A pipeline must be a JSON array of stage objects in square brackets. **Format** pretty-prints it and **Apply** runs it. — https://www.mongodb.com/docs/charts/aggregation-pipeline/ 11. The documented example unwinds `items` and then uses `$addFields` to compute `saleAmount = items.price × items.quantity`. Encoding channels can then use that derived field. — https://www.mongodb.com/docs/charts/aggregation-pipeline/ 12. `$lookup` is **not** supported in the query-bar pipeline. It is allowed in data-source (Charts view) — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/practice.md#custom-pipeline-in-the-query-bar`
- 16. A Charts view is a data source that runs an aggregation pipeline over a collection to pre-process the data. Typical uses are joins with `$lookup`, hiding fields with `$project`, and type conversion such as `$toDate`. — https://www.mongodb.com/docs/charts/data-source-pipeline/ 17. Only users with the Project Owner role can create or change Charts views. — https://www.mongodb.com/docs/charts/data-source-pipeline/ 18. Data-source pipelines with `$lookup` arrived in v1.6.0 (2019-09-03). Creating and testing pipelines in the Charts-view builder arrived in v1.33.1 (2022-09-12). — https://www.mon — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/practice.md#pipelines-that-run-before-the-chart-query`
- 30. Field sampling reads a random 50 documents from the first 10,000 in the collection. A MongoDB staff answer says this is fast unless the source is a view or a data source with a pipeline. — https://www.mongodb.com/community/forums/t/chart-gets-a-timeout-how-to-debug/106781 (Tom Hollander, MongoDB, 2021-05-19) 31. The full pipeline already runs during sampling if the chart has a query-bar entry, a data-source pipeline, a view as its source, or a lookup field. That can make sampling itself slow. — https://www.mongodb.com/community/forums/t/chart-gets-a-timeout-how-to-debug/106781 (2021-05-14) — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/practice.md#timeouts-sampling-caching`
- 39. A third-party guide says Charts runs aggregation on the server and gives a query-bar pipeline example: `$unwind` → `$group` → `$sort` → `$limit: 10`. — https://oneuptime.com/blog/post/2026-03-31-mongodb-atlas-charts-bar-chart/view (Nawaz Dhandala, 2026-03-31) 40. A secondary reference says chart performance depends on indexes like any other query. It says an unindexed `$match` on a large collection makes a chart slow, and it advises indexing the fields charts filter and sort on. — https://www.mongodb.com/docs/charts/add-lookup-field/ ; https://www.tech-interview.dev/tech/mongodb/mongodb-ch — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/practice.md#independent-third-party-views`
- - **Read the generated pipeline before tuning.** Use View Aggregation Pipeline to find where a stage actually landed (claims 1, 8). The order is fixed, and you cannot move a query-bar `$match` ahead of a Charts view. - **Filter early and use indexes.** Only the first `$match` against the base collection can use an index. That means a Charts-view `$match`, an embedding pre-filter, or a dashboard filter before any `$addFields`/`$lookup`. Put tenant and date filters there. This is why `preFilter` exists (claims 1, 23). - **Joins have two supported routes and one unsupported one.** Lookup Field (s — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/practice.md#operational-implications-derived-from-claims-above`
- - **Timeout value.** A 2021 MongoDB staff answer gives the wait as **90 seconds** (https://www.mongodb.com/community/forums/t/chart-gets-a-timeout-how-to-debug/106781). The v1.39.0 release note (2023-08-22) says only that the limit "increased to 10 minutes for experimentation" via Support (https://www.mongodb.com/docs/charts/release-notes/). A search summary of the release notes mentioned an earlier **120-second** value, but the fetched release-note text did not show it. The current default timeout is unverified. - **"Large collections render quickly."** OneUptime says server-side aggregation — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/practice.md#unresolved-disagreements`
- - B1. A filter document goes in curly brackets and uses `find()` query syntax. [M,H,E] — S3 - B2. A pipeline must be a JSON array of stage objects in square brackets. **Format** pretty-prints it and **Apply** runs it. [M,H,E,P] — S2 - B3. The doc example runs `$unwind: items` and then `$addFields saleAmount = price × quantity`. Encoding channels can then use the derived field. [P] — S2 - B4. The query bar rejects `$lookup` (see PC1). v1.22.0 (2021-02-18) improved the error message for this. [all] — S2, S20 - B5. `$function` works only if the body is a single line in double quotes with `lang: " — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#b-query-bar-segment-4`
- - F1. Segment 11 is a server-side `$limit`. When a chart hits it, Charts shows a warning, and "there is no way to determine which documents" make up the chart. [E,P] — S13 - F2. *Inference:* the `$limit` runs after `$group`, so it caps the rows returned, not the documents scanned. A pipeline that groups millions of documents into a few rows never shows the warning but can still time out. [E] — S1 - F3. Documented limits: 5000 for number, combo, choropleth, column and bar charts. 50000 for tables and scatter charts. No single source gives the full table. [M,E] — S15, S16, S17, S18, S14, S19 - F — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#f-document-limits`
- - I1. Studio 3T builds the aggregation in another tool, saves it as a MongoDB View, and points Charts at the View. Staff list a View-backed source as a slow-query cause (G3), so this route trades speed for flexibility. [E] — S32, S25 — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#i-workaround-used-outside-mongodb`
- 37. A third-party workflow builds the aggregation in another tool, saves it as a MongoDB View, and points Charts at that View. This avoids the query-bar restrictions. Claim 31 lists a View-backed data source as a slow-query trigger, so this route trades flexibility for speed. https://studio3t.com/knowledge-base/articles/mongodb-charts/ ; https://www.mongodb.com/community/forums/t/chart-gets-a-timeout-how-to-debug/106781 — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/edge-cases.md#workaround-seen-outside-mongodb`
- - **Timeout value.** In 2021, staff said 90 seconds (claim 30). The 2023 release note says 10 minutes, but only through Support (claim 33). No current page gives the default timeout. Treat 90 seconds as the likely default until a current doc says otherwise. https://www.mongodb.com/community/forums/t/chart-gets-a-timeout-how-to-debug/106781 ; https://www.mongodb.com/docs/charts/release-notes/ - **`$lookup` in a chart.** The parent skill text says `$lookup` works in a custom chart pipeline. The official docs and staff say it does not work in the query bar (claims 12–13). The docs win. The parent — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/edge-cases.md#unresolved-disagreements`
- - C-L1. A lookup field uses `$lookup` to fetch matching documents from a remote collection — https://www.mongodb.com/docs/charts/add-lookup-field/ - C-L2. The remote collection must already be a Charts data source in the same database. The local collection itself is allowed. The local field must not be an embedded object — https://www.mongodb.com/docs/charts/add-lookup-field/ - C-L3. A lookup field returns either all matching documents (recommended for one-to-many) or only the first match (recommended for one-to-one and many-to-one) — https://www.mongodb.com/docs/charts/add-lookup-field/ - C-L — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/mechanism.md#d-lookup-fields-segment-5-and-calculated-fields-segment-6`
- - The current default timeout. - The full per-chart-type limit table, and whether an author can change the limit. - Whether Charts sets `allowDiskUse` or relies on the server's `allowDiskUseByDefault`. - The full list of stages the query bar rejects. `$out` and `$merge` are presumably rejected, but no source says so. - What the query bar accepted before v1.3.0. - The date of the rename to "Charts views". - Whether Charts reorders or optimizes the stages it generates. - Test needed for B14: `$search` combined with segments 1–3. — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#gaps-searched-not-found`
- - S1 https://www.mongodb.com/docs/charts/aggregation-pipeline-generation/ - S2 https://www.mongodb.com/docs/charts/aggregation-pipeline/ - S3 https://www.mongodb.com/docs/charts/filter-chart-results/ - S4 https://www.mongodb.com/docs/charts/create-manage-charts-view/ - S5 https://www.mongodb.com/docs/charts/data-source-pipeline/ - S6 https://www.mongodb.com/docs/charts/add-lookup-field/ - S7 https://www.mongodb.com/docs/charts/calculated-fields/ - S8 https://www.mongodb.com/docs/charts/filter-embedded-charts/ - S9 https://www.mongodb.com/docs/charts/dashboards/view-dashboard-data/dashboard-fil — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#sources`
- - **Gate met: 6 hosts.** mongodb.com/docs, mongodb.com/community (staff answers), studio3t.com, netdata.cloud, and the MongoDB server manual. The manual is on the same host as the Charts docs but is a separate product's documentation. - **Caveat on independence.** The Charts-specific claims (1–27, 30–36) rest almost entirely on one publisher, MongoDB: its docs, release notes, and staff forum answers. The only non-MongoDB Charts source (Studio 3T) is thin. Stack Overflow, medium.com, and npmjs.com were blocked or returned 403. The gate is met on host count but weak on publisher independence for — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/edge-cases.md#quality-gate`
- - https://www.mongodb.com/docs/charts/aggregation-pipeline-generation/ - https://www.mongodb.com/docs/charts/aggregation-pipeline/ - https://www.mongodb.com/docs/charts/filter-chart-results/ - https://www.mongodb.com/docs/charts/filter-embedded-charts/ - https://www.mongodb.com/docs/charts/dashboards/view-dashboard-data/dashboard-filtering/ - https://www.mongodb.com/docs/charts/create-manage-charts-view/ - https://www.mongodb.com/docs/charts/add-lookup-field/ - https://www.mongodb.com/docs/charts/chart-types/ - https://www.mongodb.com/docs/charts/chart-type-reference/column-bar-chart/ - https: — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/edge-cases.md#sources`
- - E1. Pre-filters (`preFilter`) run after Charts views and before the chart's queries and filters, so they cut query time early — https://www.mongodb.com/docs/charts/filter-embedded-charts/ - E2. The SDK `preFilter()` method arrived in v1.45.0 (2024-07-04) — https://www.mongodb.com/docs/charts/release-notes/ - E3. Embedding filters must use `$match` query syntax — https://www.mongodb.com/docs/charts/filter-embedded-charts/ - E4. For unauthenticated embedding, an embed may only filter on fields the chart author has explicitly allowed. No fields are allowed by default. A filter on any other fiel — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/mechanism.md#e-embedding-filters-segments-2-and-7`

## Comparisons and alternatives

- - H1. **View Aggregation Pipeline** (Chart Builder ellipsis menu) shows the full pipeline, including the data-source stages. You can copy it into Compass or `mongosh`. It arrived in v1.7.0 (2019-10-02). [all] — S11, S1, S20 - H2. The dialog is read-only. Staff called it "mainly useful for diagnostics". [H,E,P] — S23 - H3. Some Chart Builder options change only the rendering and add no stage. The exported CSV/JSON can therefore differ from what the chart shows. [M,H] — S11 - H4. Array reductions available in encodings: unwind, array length, element by index, string accumulators, and numeric acc — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#h-inspection-and-export`
- 1. Charts builds one pipeline from 11 segments in this fixed order: Charts views → embedding pre-filters → dashboard filters → chart query (query bar) → lookup fields → calculated fields → embedding filters, including injected filters → chart filters → encoded fields → sorting → maximum document limit. https://www.mongodb.com/docs/charts/aggregation-pipeline-generation/ 2. Charts skips any segment the user did not configure. https://www.mongodb.com/docs/charts/aggregation-pipeline-generation/ 3. **Correction to the parent fact.** The parent says the query-bar filter is "equivalent to the first — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/edge-cases.md#segment-order-the-main-source-of-edge-cases`
- - D1. A secondary article says custom pipelines are entered by clicking an "Aggregation Pipeline toggle to switch from collection to pipeline mode" in the data source panel, and implies `$lookup` works there (https://oneuptime.com/blog/post/2026-03-31-mongodb-how-to-use-custom-aggregation-pipelines-with-atlas-charts/view). The official docs describe only the query bar (no `$lookup`) and charts views (`$lookup` allowed, Project Owner only). The docs never mention such a toggle. The article probably merges the two entry points. Treat it as unverified. - G1. The date when "data source pipeline" ( — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/history.md#unresolved-disagreements-and-gaps`
- - F1. The maximum query response size is 5000 documents for number, combo, and choropleth charts — https://docs.mongodb.com/charts/master/chart-type-reference/number-chart/ ; https://www.mongodb.com/docs/charts/chart-type-reference/combo-charts/ ; https://www.mongodb.com/docs/charts/chart-type-reference/choropleth/ - F2. The maximum query response size for a table is 50000 documents. So the "maximum document limit" segment depends on the chart type and is not always 5000 — https://www.mongodb.com/docs/charts/chart-type-reference/data-table/ - F3. In v1.39.0 (2023-08-22) the Charts query timeou — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/mechanism.md#f-limits-execution-inspection`
- 23. Embedding pre-filters use the same syntax as filters. They run after Charts views and before the chart query and filters, so they filter early and cut query time. — https://www.mongodb.com/docs/charts/filter-embedded-charts/ 24. The SDK `preFilter` option arrived in v1.45.0 (2024-07-04). — https://www.mongodb.com/docs/charts/release-notes/ 25. Embedding filters and injected filters run at segment 7. That is after the chart query, lookup fields and calculated fields, and before the Filter pane and encoding. — https://www.mongodb.com/docs/charts/aggregation-pipeline-generation/ 26. An inject — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/practice.md#where-embedding-filters-land-security-relevant`

## Facts and statements

- - **In scope:** the backing pipeline Charts generates and the order of its segments; every route that puts stages into it (query bar, Charts views, lookup fields, calculated fields, dashboard filters, embedding pre-filters, filters and injected filters); stage restrictions; limits, timeouts, sampling and caching; how to inspect the pipeline; the dated history of all of these. - **Out of scope:** chart types, dashboard layout, SDK and JWT authentication, the REST API, cost, and the general aggregation framework. Server limits appear only where they cap a chart query. — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#scope`
- **In scope:** the aggregation pipeline that Atlas Charts builds and runs for each chart. That covers segment order, the custom pipeline typed into the query bar, which stages are allowed, document and time limits, and how filters interact with a reshaping pipeline. — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/edge-cases.md#scope`
- Run: /rabbithole, 2026-10-02. Objective: trace the evolution of the aggregation pipeline inside MongoDB Atlas Charts and identify primary sources. — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/history.md`
- In scope: the pipeline that Atlas Charts generates to render a chart (the "backing aggregation pipeline"), the user-supplied pipeline entry points that feed it (query bar, charts views, embedding filters, pre-filters), stage support and restrictions, and the dated history of these features. — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/history.md#scope`
- 15. A charts view is a data source that applies an aggregation pipeline to a collection before Charts uses it. One collection can have several charts views. — https://www.mongodb.com/docs/charts/create-manage-charts-view/ 16. Only a user with the `Project Owner` role can create or change a charts view. — https://www.mongodb.com/docs/charts/create-manage-charts-view/ 17. A charts view can use `$lookup` to join collections, hide sensitive fields, and convert data types. — https://www.mongodb.com/docs/charts/create-manage-charts-view/ — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/history.md#charts-views-segment-1`
- **Out of scope:** chart types, dashboard layout, embedding authentication, the Charts REST API, cost, and the general MongoDB aggregation framework. General framework limits appear only where they bound a chart query. — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/edge-cases.md#scope`
- Out of scope: Charts in general, chart types, dashboards as a product, the Embedding SDK beyond its pipeline-injection behaviour, Atlas Search, and the general MongoDB aggregation framework. Those are separate frontier items. — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/history.md#scope`
- - Whether Charts reorders or optimizes its generated stages. The MongoDB server's own aggregation optimizer is out of scope. - The full list of stages the query bar rejects, other than `$lookup`. `$out` and `$merge` are almost certainly rejected but have no Charts-specific source. - The default query timeout before the v1.39.0 increase. - How many documents Charts samples to build the Fields pane. — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/mechanism.md#gaps-searched-not-found`
- - **Met by host count.** Non-MongoDB origins: oneuptime.com (2 articles), studio3t.com, knowi.com, tech-interview.dev and netdata.cloud. MongoDB origins: the docs and release notes, staff forum answers, and the `mongodb-js` GitHub repo. - **Weak by publisher.** Every authoritative claim about Charts behaviour traces back to MongoDB. The independent sources are thin or secondary. Two of them (OneUptime and Knowi, which has a conflict of interest) partly contradict the docs. netdata supports only a server-general fact (F6). - All four runs were denied Firecrawl, Bash and raw `.md` fetches. Stack — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#independent-origin-gate-parent-sources-excluded`
- **Sibling concepts handed to concept-family-explorer (not pursued):** Charts views as data sources; Lookup Fields; Calculated Fields; embedding filter and SDK model (pre-filter, injected filters); dashboard refresh and caching; Atlas Search in Charts (`$search`/`$searchMeta`). — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/rabbithole-synthesis.md#saturation`
- Researched 2026-10-02 · `/rabbithole` depth pass · parent: MongoDB Atlas Charts — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/mechanism.md`
- - https://www.mongodb.com/docs/charts/aggregation-pipeline-generation/ - https://www.mongodb.com/docs/charts/aggregation-pipeline/ - https://www.mongodb.com/docs/charts/filter-chart-results/ - https://www.mongodb.com/docs/charts/create-manage-charts-view/ - https://www.mongodb.com/docs/charts/add-lookup-field/ - https://www.mongodb.com/docs/charts/calculated-fields/ - https://www.mongodb.com/docs/charts/filter-embedded-charts/ - https://www.mongodb.com/docs/charts/dashboards/view-dashboard-data/dashboard-filtering/ - https://www.mongodb.com/docs/charts/view-export-chart-data/ - https://www.mon — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/mechanism.md#sources`
- As of 2026-10-02. Parent: MongoDB Atlas Charts. Method: /rabbithole depth passes (non-interactive tier: WebSearch + WebFetch only; Firecrawl and Bash were denied). — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/practice.md`
- Handoffs for concept-family-explorer: none were pursued. Siblings touched only at their boundary are Charts embedding filters/SDK, Charts views as data sources, and dashboard refresh/caching. — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/practice.md#depth-pass-record`
- - https://www.mongodb.com/docs/charts/aggregation-pipeline-generation/ - https://www.mongodb.com/docs/charts/aggregation-pipeline/ - https://www.mongodb.com/docs/charts/chart-types/ - https://www.mongodb.com/docs/charts/data-source-pipeline/ - https://www.mongodb.com/docs/charts/add-lookup-field/ - https://www.mongodb.com/docs/charts/filter-embedded-charts/ - https://www.mongodb.com/docs/charts/dashboards/view-dashboard-data/dashboard-refresh/ - https://www.mongodb.com/docs/charts/release-notes/ - https://www.mongodb.com/community/forums/t/chart-gets-a-timeout-how-to-debug/106781 - https://www — source: `~/.global-ai-hub/research-tests/mongodb-full-frontier-20261002/full-frontier-run/aggregation-pipeline-in-charts-de7b80819a/reports/practice.md#sources`

## Related concepts

- Charts — is a part of Aggregation Pipeline in Charts
- Pipeline — is a part of Aggregation Pipeline in Charts
- Aggregation — is a part of Aggregation Pipeline in Charts
