Skip to content

Commit 5f7773a

Browse files
authored
Aggregation Pipeline Refactor [COMPLETE] (#550)
* DOCSP-28944 Stage Wizard Procedures (#492) * DOCSP-28944 Stage Wizard Procedures * wording * update screenshots * update screenshot size * NV feedback * BC feedback * DOCSP-29483 Stage Wizard Aggregation Stages (#497) * DOCSP-29483 Stage Wizard Pipeline Use Cases * alphabetize stages * missing period * note on simple uses cases via BC feedback * wording * intro text rewrite * drag and drop functionality * wording * wording * DOCSP-30041 Stage Wizard Icon Screenshots (#504) * DOCSP-29657 Stage wizard search input (#503) * DOCSP-29657 Stage Wizard Search function * delete line * wording * wording * formatting, typos, and new step * DOCSP-30592 Create Aggregation Pipeline Page (#506) * DOCSP-30592 Create Aggregation Pipeline Page * delete page * toc * toc * image res * image res * learn more * learn more * bullet * fix depth * AB feedback' * revert indentations * DOCSP-30593 Save a Pipeline Task Page (#507) * DOCSP-30593 Save a Pipeline Task Page * build errors * new learn more link, typo fixes * create a view page * toc * newline * build errors * AB feedback * DOCSP-30594 Open Saved Pipeline (#513) * DOCSP-30594 Open Saved Pipeline * copy * copy * typos * DC feedback * feedback * view vs tab * DOCSP-30595 Remove Import Pipeline from Text Page (#517) * DOCSP-30595 Remove Import Pipeline from Text Page * toc build error * DOCSP-30596 View Explain Plans (#520) * DOCSP-30596 View Explain Plans * wording * add under learn more * ref link * SO feedback * DOCSP-30597 Specify Custom Collation (#524) * DOCSP-30597 Specify Custom Collation * about section * link * JA feedback * typo * nits * DOCSP-30598 maxTimeMS Task Page (#526) * DOCSP-30598 maxTimeMS Task Page * add to toc * move content * small changes * wording * JA feedback * wording * JA About This Task feedback * DOCSP-30599 Export Aggregation Results in Compass (#529) * DOCSP-30599 Export Aggregation Results in Compass * wording * * * * * JA feedback * resize table * more feedback * style * DOCSP-31488 Create a View from Pipeline Results (#533) * DOCSP-31488 Create a View from Pipeline Results * image resize * wording * SO feedback + info typing fixes * eye icon * DOCSP-31489 Count Result Documents (#534) * DOCSP-31489 Count Result Documents * icon * new icon * copy * JD feedback * wording * DOCSP-31490 Pipeline Settings Reference Page (#536) * DOCSP-31490 Pipeline Settings Reference Page * add to toc * wording * DOCSP-27738 Aggregation Pipeline Refactor Cleanup (#538) * DOCSP-27738 Aggregation Pipeline Refactor Cleanup * remove version number * remove unnecessary Before you Begin section * remove periods from steps * remove font treatment from headers * typo * more font treatment fixes * spacing * JA feedback * JO feedback for importing pipelines * build errors * JA feedback - driver docs link * JO feedback - import text pipeline note
1 parent 418c2b1 commit 5f7773a

27 files changed

+796
-565
lines changed

snooty.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ toc_landing_pages = [
2222
"/query/queries",
2323
"/documents",
2424
"/schema",
25-
"/aggregation-pipeline-builder",
25+
"/create-agg-pipeline",
2626
"/collections"
2727
]
2828

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
.. _pipeline-builder-settings:
2+
.. _change-pipeline-settings:
3+
.. _use-sample-mode-or-auto-preview:
4+
5+
=====================================
6+
Aggregation Pipeline Builder Settings
7+
=====================================
8+
9+
.. default-domain:: mongodb
10+
11+
.. contents:: On this page
12+
:local:
13+
:backlinks: none
14+
:depth: 1
15+
:class: singlecol
16+
17+
You can adjust your |compass| Aggregation Pipeline Builder settings to customize
18+
your aggregation experience and improve pipeline performance.
19+
20+
Settings
21+
--------
22+
23+
To view and change your aggregation pipeline settings, click the gear icon at
24+
the upper right of the pipeline builder to open the :guilabel:`Settings` panel.
25+
26+
.. list-table::
27+
:header-rows: 1
28+
:widths: 15 70 15
29+
30+
* - Option
31+
- Description
32+
- Default Value
33+
34+
* - Comment Mode
35+
- When enabled, adds helper comments to each stage.
36+
- Enabled
37+
38+
* - Number of Preview Documents
39+
- Sets number of documents to show in the preview.
40+
- 10
41+
42+
* - Limit
43+
- Specifies the number of documents passed to :pipeline:`$group`,
44+
:pipeline:`$bucket`, and :pipeline:`$bucketAuto` pipeline stages. Lower
45+
limits improve pipeline run time but might result in missing documents.
46+
47+
.. note::
48+
49+
This setting is only applied to document previews. It is not applied
50+
when the pipeline is run.
51+
- 100000
52+
53+
Learn More
54+
----------
55+
56+
- :ref:`create-agg-pipeline`
57+
58+
- :ref:`pipeline-custom-collation`
59+
60+
- :ref:`set-maxtime-ms-agg`
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
.. _refresh-document-counts:
2+
.. _count-pipeline-results:
3+
4+
================================
5+
Count Pipeline Results Documents
6+
================================
7+
8+
.. default-domain:: mongodb
9+
10+
.. contents:: On this page
11+
:local:
12+
:backlinks: none
13+
:depth: 1
14+
:class: singlecol
15+
16+
You can view the number of documents outputted by your pipeline with the
17+
:guilabel:`count results` button.
18+
19+
About this Task
20+
---------------
21+
22+
When you delete or add a document, you must manually refresh the
23+
:guilabel:`count results` value on the :guilabel:`Aggregations` tab to reflect
24+
the new document count.
25+
26+
Before You Begin
27+
----------------
28+
29+
To count result documents, you must first :ref:`create and run
30+
<create-agg-pipeline>` your aggregation pipeline. You can't count result
31+
documents while editing your pipeline.
32+
33+
Steps
34+
-----
35+
36+
.. procedure::
37+
:style: normal
38+
39+
.. step:: Click the count results button
40+
41+
After you run your pipeline, click :guilabel:`count results`, which
42+
appears under the :guilabel:`Run` button. The :guilabel:`count results`
43+
button will update with the count of resulting documents.
44+
45+
.. figure:: /images/compass/agg-builder-click-count-results.png
46+
:alt: Click the count results link
47+
48+
.. step:: (Optional) Click the refresh icon
49+
50+
If you edit your pipeline, you must press the :icon-fa4:`refresh` button
51+
to update your document count.
52+
53+
Learn More
54+
----------
55+
56+
- :ref:`compass-agg-builder`
57+
58+
- :ref:`compass-documents`
59+
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
.. _create-a-view:
2+
3+
===================================
4+
Create a View from Pipeline Results
5+
===================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
To quickly access the results of an aggregation pipeline without having to
16+
run it, you can create a :ref:`view <compass-views>` on |compass|. Views are
17+
read-only, so they can help keep your data secure by limiting user access to a
18+
predefined set of results.
19+
20+
About this Task
21+
---------------
22+
23+
Creating a view does not save the aggregation pipeline itself.
24+
25+
Steps
26+
-----
27+
28+
.. procedure::
29+
:style: normal
30+
31+
.. step:: Click the Save drop-down button
32+
33+
In the aggregation pipeline pane, click the :guilabel:`Save` drop-down
34+
button and select :guilabel:`Create view`.
35+
36+
.. figure:: /images/compass/query-save-pipeline-as.png
37+
:alt: Save drop-down button
38+
39+
.. step:: Enter a name for your view
40+
41+
The view name must be between 6 and 1024 characters long.
42+
43+
.. step:: Create your view
44+
45+
Click the :guilabel:`Create` button to create your view. |compass-short|
46+
creates a view from your pipeline results in the same database where the
47+
pipeline was created and displays saved views with the :icon-fa5:`eye`
48+
icon.
49+
50+
Learn More
51+
----------
52+
53+
- :ref:`compass-views`
54+
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
.. _export-agg-builder-results:
2+
3+
===================================
4+
Export Aggregation Pipeline Results
5+
===================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
To use your aggregated data in other external tools, you can export your
16+
pipeline results from |compass| as a JSON or CSV file.
17+
18+
About this Task
19+
---------------
20+
21+
Avoid using CSV files exports to back up your data. CSV files may lose type
22+
information and are not suitable for backing up your data.
23+
24+
Steps
25+
-----
26+
27+
.. procedure::
28+
:style: normal
29+
30+
.. step:: Click the Export button
31+
32+
In the top right of the aggregation pipeline builder, click the
33+
:guilabel:`Export` button to open the modal.
34+
35+
.. figure:: /images/compass/agg-export.png
36+
:alt: Export button on aggregation pipeline
37+
:width: 696px
38+
39+
.. step:: Choose the file type for your export
40+
41+
Under :guilabel:`Export File Type`, select either :guilabel:`JSON` or
42+
:guilabel:`CSV`. If you select :guilabel:`JSON`, your data is exported
43+
to the target file as an array of JSON objects.
44+
45+
.. step:: (Optional) Choose an advanced JSON format option
46+
47+
If choose to export your data as a :guilabel:`JSON` file, you can expand
48+
the :guilabel:`Advanced JSON Format` drop-down menu and select from the
49+
following extended JSON formats:
50+
51+
.. include:: /includes/extended-json-table.rst
52+
53+
.. step:: Click Export
54+
55+
.. step:: Specify export destination
56+
57+
In the new pop-up modal, enter a name for your export file, specify the file
58+
destination, and click :guilabel:`Select` to export your pipeline results.
59+
60+
Learn More
61+
----------
62+
63+
- :ref:`export-data-collection`
64+
65+
- :ref:`compass-export-pipeline`
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
.. _compass-export-pipeline:
2+
3+
====================================
4+
Export Pipeline to Specific Language
5+
====================================
6+
7+
.. default-domain:: mongodb
8+
9+
You can use the :ref:`Aggregation Pipeline Builder
10+
<compass-agg-builder>` to format and export finished pipelines. You can export
11+
pipelines to a chosen language to use in your application.
12+
13+
About this Task
14+
---------------
15+
16+
You can export your pipeline to the following languages:
17+
18+
- C#
19+
- Go
20+
- Java
21+
- Node
22+
- PHP
23+
- Python
24+
- Ruby
25+
- Rust
26+
27+
Steps
28+
-----
29+
30+
.. procedure::
31+
:style: normal
32+
33+
.. step:: Click the Export to Language button
34+
35+
In the aggregation pipeline pane, click the :guilabel:`Export to Language`
36+
button to open the pipeline export card.
37+
38+
.. figure:: /images/compass/agg-builder-export-dropdown.png
39+
:figwidth: 720px
40+
:alt: Aggregation Builder export button
41+
42+
.. step:: Select your export language
43+
44+
On the right side of the card, click the drop-down menu under
45+
:guilabel:`Exported Pipeline` and select your desired programming
46+
language.
47+
48+
The :guilabel:`My Pipeline` pane on the left of the export card displays
49+
your pipeline in :binary:`mongosh` syntax. The
50+
:guilabel:`Exported Pipeline` pane to the right displays your pipeline in
51+
the selected programming language.
52+
53+
.. figure:: /images/compass/agg-builder-export-lang-select.png
54+
:figwidth: 720px
55+
:alt: Aggregation Builder language select
56+
57+
.. step:: (Optional) Include import statements
58+
59+
Click the :guilabel:`Include Import Statements` checkbox to include the
60+
required import statements for the selected programming language.
61+
62+
.. step:: (Optional) Include driver syntax
63+
64+
Click the :guilabel:`Include Driver Syntax` checkbox to include
65+
application code for the selected programming language. If you include
66+
driver syntax, the copyable code reflects :ref:`project
67+
<query-bar-project>`, :ref:`sort <query-bar-sort>`, :ref:`maxtimems
68+
<query-bar-max-time-ms>`, :ref:`collation <query-bar-collation>`,
69+
:ref:`skip <query-bar-skip>` and :ref:`limit <query-bar-limit>` options.
70+
71+
.. step:: Click :icon-fa4:`files-o`
72+
73+
Click the :icon-fa4:`files-o` icon at the top-right of the pipeline to
74+
copy your pipeline for the selected programming language. You can now
75+
integrate and execute your created pipeline in your application.
76+
77+
Learn More
78+
----------
79+
80+
- :ref:`Aggregation Pipeline Builder <compass-agg-builder>`
81+
82+
- :driver:`MongoDB Driver Documentation </>`

0 commit comments

Comments
 (0)