Import Pipeline from Text
You can import aggregation pipelines from plain text into the Aggregation Pipeline Builder to easily modify and execute your pipelines. Importing a plain text aggregation pipeline shows how each stage of the pipeline affects the output, and illustrates the effects of modifying specific pipeline stages using the Pipeline Builder's Output panes.
Note
Importing Pipelines From Text
Starting in Compass 1.35, the import pipeline button has been removed from the Compass GUI. The full functionality of importing pipelines from text is still supported as part of the View Pipeline as Text edit mode.
Syntax
The imported pipeline must be:
In the MongoDB query language, this is the same syntax used in the
pipeline
parameter of theaggregate()
method.An array, even if there is only one stage in the pipeline.
Procedure
In the aggregation pipeline pane, click the </> Text toggle switch to enable text mode for pipeline editing.

Type or paste an aggregation pipeline into the text editor. The text editor provides real-time linting for correct syntax and debugging information.
For example, the following pipeline consists of a single
$limit
stage:
[ { "$limit" : 4 } ]

After you import your pipeline, you can click the {} Stages switch to return to stage view mode. In this mode you can modify individual stages to see the results reflected in the Output of each respective stage.