Docs Menu

Docs HomeMongoDB Compass

Export Pipeline to Specific Language

New in version 1.15.0

You can use the Aggregation Pipeline Builder to export your finished pipeline to one of the supported languages; Java, Node, C#, and Python 3. This feature facilitates formatting and exporting pipelines created in MongoDB Compass for use in your applications.


Navigate to the collection for which you wish to export your aggregation pipeline. Click the Aggregations tab.


For instructions on creating an aggregation pipeline in MongoDB Compass, see Aggregation Pipeline Builder.

Aggregation Builder export dropdown

In the Export Pipeline To: dropdown, select your desired programming language:

Aggregation Builder language select

The My Pipeline pane on the left displays your pipeline in mongo shell syntax.

The pane to the right displays your pipeline in the selected programming language.


Check the Include Import Statements option to include the required import statements for the selected programming language.


Check the Include Driver Syntax option to include application code for the selected programming language. If you include driver syntax, the copyable code reflects project, sort, maxtimems, collation, skip and limit options.


Click at the top-right of the pipeline to copy the pipeline for the selected programming language to your clipboard. You can now integrate and execute your created pipeline into your application.



See also:

←  Import Pipeline from TextEnable Dark Mode →
Share Feedback
© 2023 MongoDB, Inc.


  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2023 MongoDB, Inc.