Introducing the Aggregation Stage Wizard in MongoDB Compass

Have you ever wanted to create an aggregation but not known where to start? We’ve got a solution for you! MongoDB just released a new feature that can help as part of our powerful aggregation experience in Compass. Starting in version 1.38, Compass’ new Aggregation Stage Wizard will help you jumpstart aggregation development by allowing you to craft aggregation stages based on your use case.

Getting started with an aggregation stage is often the hardest part. Although Compass provides a variety of editors for writing aggregations, you previously needed prior experience with MongoDB Query API syntax to get started. Otherwise, you had to rely on documentation or code examples to guide you through the process.

The Aggregation Stage Wizard addresses this common challenge. Once you know what you’d like to accomplish with your aggregation stage, you can click the Wizard icon and drag the corresponding use case to your pipeline. The Aggregation Stage Wizard then converts your use case into an aggregation stage.

Gif displaying how to open the side panel and drag and drop the $group stage into the add stage section

From there, you can enter the appropriate fields, values, and operators through a series of dropdowns and text boxes–no need to agonize over quotations and curly braces! The Aggregation Stage Wizard will convert your entries into a valid aggregation stage written in MongoDB’s Query API syntax.

Gif of how to enter info into the stage, save changes, and then view the pipeline stage.

From there, you can feel free to expand on your aggregation stage with the foundation set by the Aggregation Stage Wizard.

In using the Aggregation Stage Wizard, you’ll naturally and interactively learn how to develop aggregation stages so that pretty soon, working directly in Query API syntax will be second-nature for you.

To use the Aggregation Stage Wizard, please be sure to download the latest version of Compass. We also value your continued feedback. If you have any feedback about the Aggregation Stage Wizard, new use cases you’d like to see supported, or ideas for improving Compass more generally, please submit your feedback.

We’re continually improving Compass. Keep watching our blog for the latest updates!