Database tools
Aggregation pipelines
Build a read-only aggregation pipeline, preview stages and use results to add new stages.
Open an aggregation tab
Right-click a collection or view and choose Open aggregation. The tab is tied to that connection and namespace. It can be renamed, duplicated and moved between editor groups like a query tab.
Use Stages for an ordered outline and a focused stage editor, or Source to edit the enabled pipeline as an array. Pipeline drafts follow Remember workspace state; results remain in memory.
Build your first pipeline
For an example orders collection, this pipeline totals pending orders by customer. Paste it into Source, substituting your field names:
[
{ $match: { status: "pending" } },
{ $group: {
_id: "$customerId",
orderCount: { $sum: 1 },
totalValue: { $sum: "$total" }
} },
{ $sort: { totalValue: -1 } }
]
- Choose an output limit.
- Choose Run pipeline, or press Ctrl/Command + Enter.
- Expand result rows to inspect the grouped values.
The output limit is applied after the executed stages. It does not limit the input before grouping, so MongoDB may still process the full collection.
Work with stages
In Stages, use the filterable Add stage control to find a stage by operator or description. Suggestions take the reported MongoDB version into account. Select a stage to edit its BSON body, move it up or down, duplicate it, disable it or remove it.
Disabled stages stay in the draft but are omitted from execution and copied source. A custom stage lets you enter a read-only stage that is not in the suggestion catalog. Server capabilities, privileges and placement still determine whether MongoDB accepts it.
Preview through this stage executes the enabled prefix ending at the selected stage. Results show the scope that was actually run. Merely selecting another stage does not update those results.
Build from result properties
Right-click a result column, cell or expanded property for context-sensitive shortcuts:
- Keep matching documents or Exclude matching documents prepares a match stage.
- Group by this property prepares a grouping key and calculations.
- Summarize this property prepares a numeric calculation where applicable.
- Unwind this array prepares array expansion.
- Sort actions prepare an ordered result, and Keep selected properties prepares a projection.
Each shortcut opens a configuration dialog with a stage preview and an insertion position. Choose Add stage to change the draft, then run the pipeline explicitly. Suggestions come from the displayed output, which can have different fields from the source collection.
Copy a pipeline or save a view
Copy either the enabled pipeline array or a complete aggregate(...) command. The copied command omits Palryn's output cap and stage-preview prefix. Use Save as view… to create a standard MongoDB view from the enabled pipeline.
Execution boundaries
This editor runs bounded, read-only, collection-scoped aggregations. $out and $merge are rejected. Results are read-only and do not use the ordinary collection-query pager. The current pipeline execution has a five-second server limit as well as result-size and batch time limits.
Use Stop to end loading. Changing a draft keeps the old results with a changed notice; rerun to see the new pipeline. Use Shell for workflows that require real mongosh execution rather than this bounded editor.