Skip to content

Commit ac6f5eb

Browse files
committed
DOCSP-50497 tech review comments
1 parent f0fe4f6 commit ac6f5eb

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

source/aggregation/pipeline-stages.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ method. See the following examples to learn more about each of these approaches.
4545
];
4646

4747
// Executes the aggregation pipeline
48-
const results = collection.aggregate(pipeline);
48+
const results = async collection.aggregate(pipeline);
4949

5050
.. tab:: Direct Aggregation
5151
:tabid: pipeline-direct
5252

5353
.. code-block:: javascript
5454

5555
// Defines and executes the aggregation pipeline
56-
collection.aggregate([
56+
const results = async collection.aggregate([
5757
{ $match: { ... } },
5858
{ $group: { ... } }
5959
]);
@@ -91,20 +91,21 @@ manual.
9191
of buckets.
9292

9393
* - :manual:`$changeStream </reference/operator/aggregation/changeStream/>`
94-
- Returns a change stream cursor for the collection.
94+
- Returns a change stream cursor for the collection. Must be the first stage
95+
in the pipeline.
9596

96-
Instead of being passed to the ``aggregate()`` method,
97-
``$changeStream`` uses the ``watch()`` method on a ``Collection``
98-
object.
97+
``$changeStream`` returns an ``AggregationCursor`` when passed to the
98+
``aggregate()`` method and a ``ChangeStreamCursor`` when passed to the
99+
``watch()`` method.
99100

100101
* - :manual:`$changeStreamSplitLargeEvent
101102
</reference/operator/aggregation/changeStreamSplitLargeEvent/>`
102103
- Splits large change stream events that exceed 16 MB into smaller fragments returned
103-
in a change stream cursor.
104+
in a change stream cursor. Must be the first stage in the pipeline.
104105

105-
Instead of being passed to the ``aggregate()`` method,
106-
``$changeStreamSplitLargeEvent`` uses the ``watch()`` method on a
107-
``Collection`` object.
106+
``$changeStreamSplitLargeEvent`` returns an ``AggregationCursor`` when
107+
passed to the ``aggregate()`` method and a ``ChangeStreamCursor`` when
108+
passed to the ``watch()`` method.
108109

109110
* - :manual:`$collStats </reference/operator/aggregation/collStats/>`
110111
- Returns statistics regarding a collection or view.

0 commit comments

Comments
 (0)