New Aggregation Pipeline Text Editor Debuts in MongoDB Compass

MongoDB

#Compass

There’s a reason why Compass is one of MongoDB’s most-loved developer tools: because it provides an approachable and powerful visual user interface for interacting with data on MongoDB. As part of this, Compass’s Aggregation Pipeline Builder abstracts away the finer points of MongoDB’s Query API syntax and provides a guided experience for developing complex queries.

But what about when you want less rather than more abstraction? That’s where our new Aggregation Pipeline Text Editor comes in.

Recently released on Compass, the Aggregation Pipeline Text Editor allows users to write free-form aggregations. While users could previously write and edit pipelines through a guided and structured builder organized by aggregation stage, a text-based builder can be preferable for some users. This new pipeline editor makes it easy for users to:

  • See the entire pipeline without having to excessively scroll through the UI

  • Stay “in the flow” when writing aggregations if they are already familiar with MongoDB’s Query API syntax

  • Copy and paste aggregations built elsewhere (like in MongoDB’s VS Code Extension) into Compass

  • Use built-in syntax formatting to make pipeline text “pretty” before copying it over from Compass to other tools

Screenshot of the Aggregation Pipeline Text Editor in Compass
The Aggregation Pipeline Text Editor in Compass. Notice how toward the top right you can click on “stages” to move back to the traditional stage-based Aggregation Pipeline Builder.

Ultimately, the addition of the Aggregation Pipeline Text Editor to Compass gives users more flexibility depending on how they want to build aggregations. For a more guided experience and to get result previews when adding each new stage, the existing Aggregation Pipeline Builder will work best for most users. But when writing free-form aggregations or copying and pasting aggregation text from other tools, the Aggregation Pipeline Text Editor may be preferable. It also previews the final pipeline output, rather than the stage-by-stage preview that exists today. Users will be able to access either both the traditional Aggregation Pipeline Builder and the new Pipeline Text Editor from directly within the Aggregations tab in Compass and can switch between the two views without losing their work.

To get access to the new Aggregation Pipeline Text Editor, make sure to download the latest version of Compass here. And as always, we welcome your continued feedback on how to improve Compass. If you have ideas for how to improve your experience with Compass you can submit them on our UserVoice platform here.

We’ll have even more great features coming in Compass soon. Keep checking back on our blog for the latest news!