You can use the Aggregation Pipeline Builder to format and export finished pipelines. You can export pipelines to a chosen language to use in your application.
About this Task
You can export your pipeline to the following languages:
- C#
- Go
- Java
- Node
- PHP
- Python
- Ruby
- Rust
Steps
Click Export to Language
In the aggregation pipeline pane, click the Export to Language button to open the pipeline export card.

Select your export language
On the right side of the card, click the drop-down menu under Exported Pipeline and select your desired programming language.
The My Pipeline pane on the left of the export card displays your pipeline in mongosh syntax. The Exported Pipeline pane to the right displays your pipeline in the selected programming language.
(Optional) Include import statements
Click the Include Import Statements checkbox to include the required import statements for the selected programming language.