Skip to content

DOCSP-10258 window functions #5524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
8 changes: 2 additions & 6 deletions source/reference/operator/aggregation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1132,15 +1132,11 @@ Alphabetical Listing of Expression Operators
/reference/operator/aggregation/convert
/reference/operator/aggregation/cos
/reference/operator/aggregation/cosh
<<<<<<< HEAD
/reference/operator/aggregation/count-accum
/reference/operator/aggregation/dateAdd
/reference/operator/aggregation/dateDiff
=======
/reference/operator/aggregation/count-accumulator
/reference/operator/aggregation/covariancePop
/reference/operator/aggregation/covarianceSamp
>>>>>>> f7253052c... DOCSP-10258 window functions
/reference/operator/aggregation/dateAdd
/reference/operator/aggregation/dateDiff
/reference/operator/aggregation/dateFromParts
/reference/operator/aggregation/dateSubtract
/reference/operator/aggregation/dateToParts
Expand Down
89 changes: 0 additions & 89 deletions source/reference/operator/aggregation/count-accum.txt

This file was deleted.

13 changes: 11 additions & 2 deletions source/reference/operator/aggregation/count-accumulator.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ Definition

Returns the number of documents.

.. admonition:: Disambiguation
:class: note
.. note:: Disambiguation

This page describes the ``$count`` aggregation accumulator. For the
``$count`` aggregation pipeline stage, see :pipeline:`$count
Expand All @@ -47,6 +46,16 @@ Returns the number of documents.

:group:`$count` does not accept any parameters.

Behavior
--------

:group:`$count` is functionally equivalent to using ``{ $sum : 1 }``
within the :pipeline:`$group` stage.

.. seealso::

:group:`$sum`

Examples
--------

Expand Down
3 changes: 1 addition & 2 deletions source/reference/operator/aggregation/count.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ Definition
Passes a document to the next stage that contains a count of the
number of documents input to the stage.

.. admonition:: Disambiguation
:class: note
.. note:: Disambiguation

This page describes the ``$count`` aggregation pipeline stage.
For the ``$count`` aggregation accumulator, see :group:`$count
Expand Down
3 changes: 1 addition & 2 deletions source/reference/operator/aggregation/first.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ documents. Only meaningful when documents are in a defined order.

.. include:: /includes/extracts/fact-aggregation-accumulator-first.rst

.. admonition:: Disambiguation
:class: note
.. note:: Disambiguation

This page describes the :group:`$first` aggregation accumulator. For
the :expression:`$first` array operator, see :expression:`$first
Expand Down
4 changes: 2 additions & 2 deletions source/reference/operator/aggregation/integral.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ documents forming a trapezoid using the:
Specifies the :ref:`expression <aggregation-expressions>` to
evaluate. You must provide an expression that returns a number.

* - :ref:`unit <integral-outputUnit>`
* - :ref:`unit <integral-unit>`

- .. _integral-outputUnit:
- .. _integral-unit:

.. include:: /includes/outputUnit-behavior.rst

Expand Down
3 changes: 1 addition & 2 deletions source/reference/operator/aggregation/last.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ Only meaningful when documents are in a defined order.

.. include:: /includes/extracts/fact-aggregation-accumulator-last.rst

.. admonition:: Disambiguation
:class: note
.. note:: Disambiguation

This page describes the :group:`$last` aggregation accumulator. For
the :expression:`$last` array operator, see :expression:`$last (array
Expand Down
5 changes: 3 additions & 2 deletions source/release-notes/5.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ MongoDB 5.0 introduces the following aggregation operators:

* - :group:`$count`
- :group:`$count (aggregation accumulator) <$count>`
provides a count of all documents when used in a
:pipeline:`$group (aggregation) <$group>` pipeline stage.
provides a count of all documents when used in the existing
pipeline :pipeline:`$group (aggregation) <$group>` stage and the
new MongoDB 5.0 :pipeline:`$setWindowFields` stage.

.. note:: Disambiguation

Expand Down