A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.mongodb.com/docs/atlas/atlas-ui/create-agg-pipeline/ below:

Create an Aggregation Pipeline - Atlas

The new Data Explorer user interface is available in Public Preview and includes new features that weren't present in the old interface. To learn more, see

Preview Features

.

The Aggregation Pipeline Builder in Atlas helps you create aggregation pipelines to process documents from a collection or view and return computed results.

Atlas provides different modes to create aggregation pipelines:

To build an aggregation pipeline, choose a collection and click the Aggregations tab. Atlas displays a blank aggregation pipeline. The Preview of Documents in the Collection section shows 10 documents randomly sampled from the chosen collection.

Note Atlas Search Stages

When you connect to a MongoDB deployment hosted on Atlas, Atlas-only stages $search and $searchMeta become available in the Aggregation Pipeline Builder. Use these stages to perform full-text search on Atlas collections.

To see how to create an aggregation pipeline, select the tab corresponding to your chosen view mode:

In the aggregation pipeline pane, ensure the {} Stages toggle switch is selected.

At the bottom of the aggregation pipeline pane, click the + Add Stage button.

On the upper-left corner of the aggregation stage card, click the Select drop-down menu and select the aggregation pipeline stage to use for the first stage of the pipeline.

Fill in your selected stage. You can adjust the width of the pipeline stage by dragging its border to the right.

Note

The toggle to the right of each pipeline stage name dictates whether that stage is included in the pipeline. Toggling a pipeline stage also updates the pipeline preview, which updates based on whether or not that stage is included.

For example, the following pipeline excludes the first $match stage and only includes the $project stage:

To add an additional pipeline stage after your last aggregation stage, click Add Stage. To add an aggregation stage before your most recently added stage, click the + icon above the stage card.

Repeat steps 3 and 4 for each additional stage.

Note

You can change the order of pipeline stages by dragging the header of each stage card.

At the top-right corner of the pipeline builder, click Run. Atlas returns your results in the document view.

Warning

Some aggregation operators, like $merge and $out, can modify your collection's data.

If your aggregation pipeline contains operators that can modify your collection's data, you are prompted for confirmation before the pipeline is executed.

In the aggregation pipeline pane, ensure the {} Stages toggle switch is selected.

To the right of the view mode toggle, click the wand icon to open the Stage Wizard card.

On the Stage Wizard card, you can filter the use cases by searching for keywords associated with the use case or aggregation stage.

On the Stage Wizard card, select a stage use case for the first stage of your pipeline. You can click the stage card to add it to the end of your pipeline or drag it to your preferred position.

After you select a use case, Atlas populates the stage card with a form that corresponds to the selected aggregation pipeline stage.

The Stage Wizard use cases include the following aggregation stages:

Fill in the form for your selected stage and click Apply. After you click Apply, the form will turn into a stage card that you can edit in Stage View Mode, Focus Mode, or Text View Mode.

Atlas populates the Stage Output with up to ten sample output documents.

Note

You cannot edit an existing stage through the Stage Wizard. The Stage Wizard can only add new stages. To edit an existing stage, use Stage View Mode, Focus Mode, or Text View Mode.

To add more aggregation stages to your pipeline, repeat steps 3 and 4 for each additional stage.

Tip

You can change the order of pipeline stages by dragging the header of each stage card.

At the top-right corner of the pipeline builder, click Run. Atlas returns your results in the document view.

In the aggregation pipeline pane, ensure the {} Stages toggle switch is selected.

If you have not already created an aggregation stage, click the + Add Stage button at the bottom of the aggregation pipeline pane.

On the upper-right corner of the stage card, click the Focus Mode icon.

Fill in your selected stage. Atlas populates the Stage Output with up to ten sample output documents.

You can adjust the width of the Stage Input, stage editor, and the Stage Output by dragging their border to the desired size.

Note

The toggle to the right of each pipeline stage name dictates whether that stage is included in the pipeline. Toggling a pipeline stage also updates the pipeline preview, which updates based on whether or not that stage is included.

Click the Add Stage dropdown to add additional aggregation stages before or after your last aggregation stage. Repeat steps 4 and 5 for each additional stage.

You can add stages with the following keyboard shortcuts:

To navigate between different stages, select the stage you want to edit from the Stage dropdown in the upper-left corner of the Focus Mode modal.

You can navigate between stages with the following keyboard shortcuts:

Click x to exit Focus Mode and select Run at the top right of the pipeline builder. Atlas returns your results in the document view.

In the aggregation pipeline pane, click the </> Text toggle switch to enable text mode for pipeline editing.

Enter valid aggregation syntax into the text editor. The text editor provides real-time linting for correct syntax and debugging information.

You can also use Text View Mode to import aggregation pipelines from plain text by typing or pasting your pipeline into the text editor.

For example, following pipeline limits the query results to 4 documents.

Note

To expand all embedded fields and documents within the preview results, click Output Options and select Expand all fields.

Click Run at the top right of the pipeline builder. Atlas returns your results in the document view.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4