@@ -73,8 +73,70 @@ Limitations
73
73
Create an Aggregation Pipeline
74
74
------------------------------
75
75
76
+ Aggregation pipelines can be created in two seperate modes:
77
+
78
+ - Stage View Mode, a visual click-based pipeline editor that
79
+ preloads pipeline syntax based on your selected stages.
80
+
81
+ - Text View Mode, a text-based pipeline editor that accepts raw
82
+ pipeline syntax.
83
+
84
+ .. _create-agg-pipeline-stageview:
85
+
86
+ Stage View Mode
87
+ ~~~~~~~~~~~~~~~
88
+ |
89
+
76
90
.. include:: /includes/steps/create-agg-pipeline.rst
77
91
92
+ .. _create-agg-pipeline-textview:
93
+
94
+ Text View Mode
95
+ ~~~~~~~~~~~~~~
96
+ |
97
+
98
+ .. procedure::
99
+ :style: normal
100
+
101
+ .. step:: In the aggregation pipeline pane, click the
102
+ :guilabel:`</> Text` toggle switch to enable text mode for
103
+ pipeline editing.
104
+
105
+ .. figure:: /images/compass/agg-builder-textview-toggle-on.png
106
+ :alt: Toggle textmode on
107
+
108
+ .. step:: Enter valid aggregation syntax in the text editor.
109
+ The following example pipeline limits the query results to ``4``
110
+ documents.
111
+
112
+ .. code-block:: javascript
113
+
114
+ [ { "$limit" : 4 } ]
115
+
116
+ .. figure:: /images/compass/agg-builder-textview-edit.png
117
+ :alt: Edit the text aggregation pipeline
118
+
119
+ .. step:: **(Optional)** If preview mode is enabled, you can
120
+ click :guilabel:`Output Options` in the Pipeline Output pane to
121
+ expand all nested fields and documents within the
122
+ preview results.
123
+
124
+ .. figure:: /images/compass/agg-builder-textview-expand-pipeline-preview.png
125
+ :alt: Pipeline Output preview
126
+
127
+ .. step:: Click :guilabel:`Run` at the top right of the pipeline builder.
128
+ |compass-short| returns your results in the document view.
129
+
130
+ .. figure:: /images/compass/agg-builder-textview-agg-results.png
131
+ :alt: Results after Running Aggregation
132
+
133
+ .. step:: **(Optional)** Click the :guilabel:`Output Options` dropdown
134
+ and select :guilabel:`Expand all fields` to expand all nested
135
+ fields and documents within the query results.
136
+
137
+ .. figure:: /images/compass/agg-builder-textview-expand-results.png
138
+ :alt: Expand the aggregation pipeline results
139
+
78
140
.. _save-agg-pipeline:
79
141
80
142
Save a Pipeline
0 commit comments