@@ -12,30 +12,59 @@ Import Pipeline from Text
12
12
:depth: 1
13
13
:class: singlecol
14
14
15
- *New in version 1.15.0*
16
-
17
15
You can import aggregation pipelines from plain text into
18
16
the :ref:`Aggregation Pipeline Builder <compass-agg-builder>` to
19
17
easily modify and execute your pipelines. Importing a plain text
20
18
aggregation pipeline shows how each stage of the pipeline
21
19
affects the output, and illustrates the effects of modifying specific
22
20
pipeline stages using the Pipeline Builder's :guilabel:`Output` panes.
23
21
22
+ .. note:: Importing Pipelines From Text
23
+
24
+ Starting in Compass 1.35, the import pipeline button has been removed
25
+ from the Compass GUI. The full functionality of importing pipelines
26
+ from text is still supported as part of the View Pipeline as
27
+ Text edit mode.
28
+
29
+
24
30
Syntax
25
31
------
26
32
27
- The imported pipeline must be in the
28
- :manual:`MongoDB query language </tutorial/query-documents/>`
29
- (i.e. the same syntax used as the ``pipeline`` parameter of the
30
- :manual:`db.collection.aggregate()
31
- </reference/method/db.collection.aggregate/>` method). The imported
32
- pipeline must be an array, even if there is only one stage in the
33
- pipeline.
33
+ The imported pipeline must be:
34
+
35
+ - In the :manual:`MongoDB query language </tutorial/query-documents/>`,
36
+ this is the same syntax used in the ``pipeline`` parameter of the
37
+ :method:`aggregate() <db.collection.aggregate()>` method.
38
+ - An array, even if there is only one stage in the pipeline.
34
39
35
40
Procedure
36
41
---------
37
42
38
- .. include:: /includes/steps/import-pipeline-from-text.rst
43
+ .. procedure::
44
+ :style: normal
45
+
46
+ .. step:: In the aggregation pipeline pane, click the
47
+ :guilabel:`</> Text` toggle switch to enable text mode for
48
+ pipeline editing.
49
+
50
+ .. figure:: /images/compass/agg-builder-textview-toggle-on.png
51
+ :alt: Toggle Textview Mode on
52
+
53
+ .. step:: Type or paste an aggregation pipeline into the
54
+ text editor. The text editor provides real-time linting
55
+ for correct syntax and debugging information.
56
+
57
+ For example, the following pipeline consists of a single
58
+ :pipeline:`$limit` stage:
59
+
60
+ .. code-block:: javascript
61
+
62
+ [ { "$limit" : 4 } ]
63
+
64
+ .. figure:: /images/compass/agg-builder-textview-edit.png
65
+ :alt: Edit aggregation pipeline
39
66
40
- Once you import your pipeline, you can add and modify individual stages
41
- and see the results reflected in the :guilabel:`Output` of each respective stage.
67
+ After you import your pipeline, you can click the :guilabel:`{} Stages`
68
+ switch to return to stage view mode. In this mode you can modify
69
+ individual stages to see the results reflected in the
70
+ :guilabel:`Output` of each respective stage.
0 commit comments