Skip to content

Commit d497b13

Browse files
DOCSP-19834 Adding topN bottomN pages (#74)
* DOCSP-19834 topN bottomN * Apply suggestions from code review Suggestions PS3 Co-authored-by: jeff-allen-mongo <[email protected]> * topN and extracts-agg-operators.yaml updates * add .'s to extracts * rearranging code blocks and descriptions * fixing group build error and updating window function verbiage * Apply suggestions from code review Co-authored-by: jeff-allen-mongo <[email protected]> * Added the example pipeline to each example ++ * added topn bottomN to alphabetical list on aggregation.txt * fix indent on aggregation.txt * attempting to fix build errors on aggregation.txt * * * address andrei comments 1 * fix builderrors? * ** * address nit changes * final adjustments * add 5.2 release notes * * * alpha release table Co-authored-by: jeff-allen-mongo <[email protected]>
1 parent 780b9fe commit d497b13

File tree

7 files changed

+840
-6
lines changed

7 files changed

+840
-6
lines changed

source/includes/extracts-agg-operators.yaml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,16 @@ content: |
10081008
10091009
Available in :pipeline:`$setWindowFields` stage.
10101010
1011+
* - :group:`$bottomN`
1012+
1013+
- Returns an aggregation of the bottom ``n`` fields within a group,
1014+
according to the specified sort order.
1015+
1016+
.. versionadded:: 5.2
1017+
1018+
Available in :pipeline:`$group` and
1019+
:pipeline:`$setWindowFields` stages.
1020+
10111021
* - :group:`$count`
10121022
10131023
- Returns the number of documents in a group.
@@ -1095,6 +1105,16 @@ content: |
10951105
10961106
Available in :pipeline:`$setWindowFields` stage.
10971107
1108+
* - :group:`$topN`
1109+
1110+
- Returns an aggregation of the top ``n`` fields within a group,
1111+
according to the specified sort order.
1112+
1113+
.. versionadded:: 5.2
1114+
1115+
Available in :pipeline:`$group` and
1116+
:pipeline:`$setWindowFields` stages.
1117+
10981118
---
10991119
ref: agg-operators-accumulators-project
11001120
content: |
@@ -1180,6 +1200,16 @@ content: |
11801200
11811201
Available in :pipeline:`$setWindowFields` stage.
11821202
1203+
* - :group:`$bottomN`
1204+
1205+
- Returns an aggregation of the bottom ``n`` fields within a group,
1206+
according to the specified sort order.
1207+
1208+
.. versionadded:: 5.2
1209+
1210+
Available in :pipeline:`$group` and
1211+
:pipeline:`$setWindowFields` stages.
1212+
11831213
* - :group:`$count`
11841214
11851215
- Returns the number of documents in the group or window.
@@ -1341,5 +1371,13 @@ content: |
13411371
.. versionchanged:: 5.0
13421372
13431373
Available in :pipeline:`$setWindowFields` stage.
1374+
1375+
* - :group:`$topN`
1376+
1377+
- Returns an aggregation of the top ``n`` fields within a group,
1378+
according to the specified sort order.
1379+
1380+
.. versionadded:: 5.2
13441381
1345-
...
1382+
Available in :pipeline:`$group` and
1383+
:pipeline:`$setWindowFields` stages.

source/includes/setWindowFields-operators.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ These operators can be used with the :pipeline:`$setWindowFields` stage:
22

33
.. _setWindowFields-accumulator-operators:
44

5-
- Accumulator operators: :group:`$addToSet`, :group:`$avg`,
6-
:group:`$count`, :group:`$covariancePop`, :group:`$covarianceSamp`,
7-
:group:`$derivative`, :group:`$expMovingAvg`, :group:`$integral`,
8-
:group:`$max`, :group:`$min`, :group:`$push`, :group:`$stdDevSamp`,
9-
:group:`$stdDevPop`, and :group:`$sum`.
5+
- Accumulator operators: :group:`$addToSet`, :group:`$avg`,
6+
:group:`$bottomN`, :group:`$count`, :group:`$covariancePop`,
7+
:group:`$covarianceSamp`, :group:`$derivative`,
8+
:group:`$expMovingAvg`, :group:`$integral`, :group:`$max`,
9+
:group:`$min`, :group:`$push`, :group:`$stdDevSamp`,
10+
:group:`$stdDevPop`, :group:`$sum` and :group:`$topN`.
1011

1112
.. _setWindowFields-gap-filling-operators:
1213

source/reference/operator/aggregation.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,16 @@ Alphabetical Listing of Expression Operators
265265

266266
.. versionadded:: 4.4
267267

268+
* - :group:`$bottomN`
269+
270+
- Returns an aggregation of the bottom ``n`` fields within a group,
271+
according to the specified sort order.
272+
273+
.. versionadded:: 5.2
274+
275+
Available in :pipeline:`$group` and
276+
:pipeline:`$setWindowFields` stages.
277+
268278
* - :expression:`$bsonSize`
269279

270280
- Returns the size in bytes of a given document (i.e. bsontype
@@ -1084,6 +1094,16 @@ Alphabetical Listing of Expression Operators
10841094
- Converts value to an ObjectId.
10851095

10861096

1097+
* - :group:`$topN`
1098+
1099+
- Returns an aggregation of the top ``n`` fields within a group,
1100+
according to the specified sort order.
1101+
1102+
.. versionadded:: 5.2
1103+
1104+
Available in :pipeline:`$group` and
1105+
:pipeline:`$setWindowFields` stages.
1106+
10871107
* - :expression:`$toString`
10881108

10891109
- Converts value to a string.

0 commit comments

Comments
 (0)