Skip to content

DOCS-8829 - Added manual page for bucketAuto pipeline stage. #2762

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

Closed
wants to merge 1 commit into from
Closed
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
103 changes: 103 additions & 0 deletions source/includes/apiargs-pipeline-bucketAuto-field.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: groupBy
position: 1
type: expression
description: |
An :ref:`expression <aggregation-expressions>` to group documents
by. To specify a :ref:`field path<agg-quick-ref-field-paths>`,
prefix the field name with a dollar sign ``$`` and enclose it in
quotes.
optional: false
operation: bucketAuto
interface: pipeline
arg_name: field
---
name: buckets
position: 2
type: integer
description: |
A positive 32-bit integer that specifies the number of buckets into
which input documents are grouped.
optional: false
interface: pipeline
operation: bucketAuto
arg_name: field
---
name: output
position: 3
type: document
description: |
A document that specifies the fields to include in
the output documents in addition to the ``_id`` field. To
specify the field to include, you must use :ref:`accumulator
expressions <agg-quick-reference-accumulators>`:

.. code-block:: javascript

<outputfield1>: { <accumulator>: <expression1> },
...

The default ``count`` field is not included in the output document
when ``output`` is specified. Explicitly specify the ``count``
expression as part of the ``output`` document to include it:

.. code-block:: javascript

output: {
<outputfield1>: { <accumulator>: <expression1> },
...
count: { $sum: 1 }
}

optional: true
interface: pipeline
operation: bucketAuto
arg_name: field
---
name: granularity
position: 4
type: string
description: |
A string that specifies the `preferred number series
<https://en.wikipedia.org/wiki/Preferred_number>`_ to use to
ensure that the calculated boundary edges end on preferred
round numbers or their powers of 10.

Available only if the all ``groupBy`` values are numeric and
none of them are ``NaN``.

The suppported values of ``granularity`` are:

.. list-table::
:class: index-table

* -
- ``"R5"``

- ``"R10"``

- ``"R20"``

- ``"R40"``

- ``"R80"``

- ``"1-2-5"``

- - ``"E6"``

- ``"E12"``

- ``"E24"``

- ``"E48"``

- ``"E96"``

- ``"E192"``

- ``"POWERSOF2"``
optional: true
interface: pipeline
operation: bucketAuto
arg_name: field
...
18 changes: 14 additions & 4 deletions source/includes/ref-toc-aggregation-pipeline-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ name: :pipeline:`$geoNear`
file: /reference/operator/aggregation/geoNear
description: |
Returns an ordered stream of documents based on the proximity to a
geospatial point. Incorporates the functionality of :pipeline:`$match`,
geospatial point. Incorporates the functionality of
:pipeline:`$match`,
:pipeline:`$sort`, and :pipeline:`$limit` for geospatial data. The
output documents include an additional distance field and can
include a location identifier field.
Expand All @@ -103,12 +104,21 @@ description: |
Returns statistics regarding the use of each index for the
collection.
---
name: :pipeline:`$bucketAuto`
file: /reference/operator/aggregation/bucketAuto
description: |
Categorizes incoming documents into a specific number of groups,
called buckets, based on a range of values for a specified
expression. The bucket ranges are automatically determined in an
attempt to evenly distribute the documents into the specified
number of buckets.
---
name: :pipeline:`$sortByCount`
file: /reference/operator/aggregation/sortByCount
description: |
Categorizes documents by grouping them according to the specified
expression, then computes the count of documents in each distinct
group.
Categorizes incoming documents by grouping them according to the
specified expression, then computes the count of documents in each
distinct group.
---
name: :pipeline:`$addFields`
file: /reference/operator/aggregation/addFields
Expand Down
Loading