Skip to content

Commit 25b75a9

Browse files
DOCSP-12764 Add support for aggregation comments (#93)
* DOCSP-12764 Add support for aggregation comments * DOCSP-12764 updates for tech review feedback DOCSP-12764 updates DOCSP-12764 updates
1 parent e539b3b commit 25b75a9

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

source/admin/determine-query-status.txt

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,33 @@ documents with the following fields:
109109
Examples
110110
--------
111111

112-
For the example below, suppose the following query is being run on the
113-
``airbnb`` collection in the ``sample`` database described in the
114-
:doc:`Getting Started tutorial
115-
</tutorial/configure-database-collections/>`.
112+
For the example below, suppose one of the following queries is running on
113+
the ``airbnb`` collection in the ``sample`` database described in the
114+
:doc:`Getting Started tutorial </tutorial/configure-database-collections/>`.
116115

117-
.. code-block:: json
116+
.. tabs::
117+
118+
.. tab:: find Command
119+
:tabid: find
120+
121+
.. code-block:: json
122+
123+
db.airbnb.find( { "address.market" : "Porto", "review_scores.review_scores_rating": {$gt: 79}}).comment("Find properties in Porto")
124+
125+
.. tab:: aggregate Command
126+
:tabid: aggregate
127+
128+
.. code-block:: json
118129

119-
db.airbnb.find( { "address.market" : "Porto", "review_scores.review_scores_rating": {$gt: 79}})
130+
db.airbnb.aggregate(
131+
[
132+
{
133+
$match: {
134+
"address.market": "Porto",
135+
"review_scores.review_scores_rating": {$gt: 79}
136+
}
137+
}
138+
], { comment: "Find properties in Porto" })
120139

121140
The following example returns information on the previous query running on
122141
the ``airbnb`` collection in the ``sample`` database:
@@ -163,6 +182,7 @@ processed at the time that ``$currentOp`` was run.
163182
"$gt" : 79
164183
}
165184
},
185+
"comment" : "Find properties in Porto",
166186
"lsid" : {
167187
"id" : UUID("2211f8ac-56b2-4ba4-bb0c-2e5dd5b7cc21")
168188
},

source/supported-unsupported/mql-support.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ Aggregation Commands
4141

4242
- The following limitations apply:
4343

44-
* Only the ``explain`` and ``cursor`` options are supported.
44+
* Only the ``explain``, ``cursor``, and ``comment`` options are
45+
supported. Note that {+adl+} only supports type ``string`` for
46+
the ``comment`` option.
4547
* The ``$collStats``, ``$geoNear``, ``$graphLookup``,
4648
``$indexStats``, ``$listLocalSessions``, and ``$listSessions``
4749
:manual:`aggregation pipeline stages

0 commit comments

Comments
 (0)