What problem does it solve?
When plain find queries cannot express grouping, joins, reshaping, or multi-stage transformations, this Skill runs MongoDB aggregation pipelines to produce reporting, enrichment, and materialized outputs without manual pipeline orchestration.
Core Features & Use Cases
- Execute multi-stage aggregation pipelines against a target database and collection with configurable options such as allowDiskUse and explain.
- Support for reading Extended JSON input from an environment variable or stdin and returning either result documents or an explain plan.
- Practical guidance on pipeline design: push $match early, keep $project tight, use explain for slow pipelines, and treat $merge/$out as destructive writes.
- Use cases include analytics reports, denormalized views, exports, enrichment jobs, and ad-hoc investigative queries.
Quick Start
Provide a JSON payload or set AGGREGATION_INPUT_JSON with database, collection, and pipeline and run the included node script to execute the aggregation and receive results or an explain plan.