Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions source/includes/intro-aggregation-accumulator.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
Available for use in the :pipeline:`$group` stage, accumulators are
operators that maintain their state (e.g. totals, maximums, minimums,
and related data) as documents progress through the pipeline.
Aggregation accumulator operators:

When used as accumulators in the :pipeline:`$group` stage, these
operators take as input a single expression, evaluating the expression
once for each input document, and maintain their stage for the group of
documents that share the same group key.
- Maintain their state as documents progress through the aggregation
pipeline.

- Return totals, maxima, minima, and other values.

- Can be used in these aggregation pipeline stages:

- :pipeline:`$group`

- :pipeline:`$bucket`

- :pipeline:`$bucketAuto`

- :pipeline:`$setWindowFields` starting in MongoDB 5.0 (except when
you are using the :group:`$accumulator` or
:expression:`$mergeObjects` operators, which cannot be used with
:pipeline:`$setWindowFields`)
4 changes: 2 additions & 2 deletions source/meta/aggregation-quick-reference.txt
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ Type Expression Operators

.. _agg-quick-reference-accumulators:

Accumulators (``$group``)
~~~~~~~~~~~~~~~~~~~~~~~~~~
Accumulators (``$group, $bucket, $bucketAuto, $setWindowFields``)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: /includes/intro-aggregation-accumulator.rst

Expand Down
4 changes: 2 additions & 2 deletions source/reference/operator/aggregation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ Type Expression Operators

.. _agg-operators-group-accumulators:

Accumulators (``$group``)
~~~~~~~~~~~~~~~~~~~~~~~~~~
Accumulators (``$group, $bucket, $bucketAuto, $setWindowFields``)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: /includes/intro-aggregation-accumulator.rst

Expand Down