Skip to content

DOCS-1208 agg command overview/xref #1010

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
7 changes: 7 additions & 0 deletions bin/htaccess.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1783,4 +1783,11 @@ code: 301
outputs:
- 'after-v2.2'
- 'manual'
---
redirect-path: '/reference/aggregation-reference-overview'
url-base: '/aggregation'
type: 'redirect'
code: 303
outputs:
- 'v2.2'
...
1 change: 1 addition & 0 deletions source/aggregation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ aggregation tools for MongoDB here:
reference/sql-aggregation-comparison
core/map-reduce
reference/simple-aggregation
reference/aggregation-commands-overview
130 changes: 130 additions & 0 deletions source/includes/table-aggregation-xref.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# table structure. all content symbolic.
section: layout
header: [ meta.header4, meta.header3, meta.header2, meta.header1]
rows:
- 1: [ meta.row1, content.agg1, content.mr1, content.grp1]
- 2: [ meta.row2, content.agg2, content.mr2, content.grp2]
- 3: [ meta.row3, content.agg3, content.mr3, content.grp3]
- 4: [ meta.row4, content.agg4, content.mr4, content.grp4]
- 5: [ meta.row5, content.agg5, content.mr5, content.grp5]
- 6: [ meta.row6, content.blank, content.v8, content.v8]
- 7: [ meta.row7, content.agg7, content.mr7, content.grp7]
---
# table metadata, as meta.<key>
section: meta
header1: :dbcommand:`group`
header2: :dbcommand:`mapReduce`
header3: :dbcommand:`aggregate`
header4: " "
row1: "**Description**"
row2: "**Key Features**"
row3: "**Flexibility**"
row4: "**Output Results**"
row5: "**Sharding**"
row6: "**Notes**"
row7: "**More Information**"
---
# table content, as content.<key>
section: content
blank: " "
v8: |
Prior to 2.4, JavaScript code executed in a single thread.
grp1: |
Provides grouping functionality.

Is slower than the :dbcommand:`aggregate` command and has less
functionality than the :dbcommand:`mapReduce` command.

grp2: |
Can either group by existing fields or with a custom ``keyf``
JavaScript function, can group by calculated fields.

See :dbcommand:`group` for information and example using the
``keyf`` function.
grp3: |
Custom ``reduce`` and ``finalize`` JavaScript functions offer
flexibility to grouping logic.

See :dbcommand:`group` for details and restrictions on these
functions.

grp4: |
Returns results inline as an array of grouped items.

The result set must fit within the :ref:`maximum BSON document
size limit <limit-bson-document-size>`.

.. versionchanged:: 2.2
The returned array can contain at most 20,000 elements; i.e.
at most 20,000 unique groupings. Previous versions had a limit
of 10,000 elements.
grp5: |
Does **not** support sharded collection.
grp7: |
See :dbcommand:`group`.
mr1: |
Implements the Map-Reduce aggregation for processing large data sets.
mr2: |
In addition to grouping operations, can perform complex
aggregation tasks as well as perform incremental aggregation on
continuously growing datasets.

See :doc:`/tutorial/map-reduce-examples/` and
:doc:`/tutorial/perform-incremental-map-reduce/`.

mr3: |
Custom ``map``, ``reduce`` and ``finalize`` JavaScript
functions offer flexibility to aggregation logic.

See :dbcommand:`mapReduce` for details and restrictions
on the functions.
mr4: |
Returns results in various options (inline, new collection, merge,
replace, reduce). See :dbcommand:`mapReduce` for details on the
output options.

.. versionchanged:: 2.2
Provides much better support for sharded map-reduce output than
previous versions.
mr5: Supports non-sharded and sharded input collections.
mr7: |
See :doc:`/core/map-reduce` and :dbcommand:`mapReduce`.
agg1: |
.. versionadded:: 2.2

Designed with specific goals of improving performance and
usability for aggregation tasks.

Uses a "pipeline" approach where objects are transformed as they
pass through a series of pipeline operators such as
:pipeline:`$group`, :pipeline:`$match`, and :pipeline:`$sort`.

See :doc:`/reference/aggregation` for more information on the
pipeline operators.
agg2: |
Pipeline operators can be repeated as needed.

Pipeline operators need not produce one output document for every
input document.

Can also generate new documents or filter out documents.
agg3: |
Limited to the operators and expressions supported by the
Aggregation Framework.

However, can add computed fields, create new virtual sub-objects,
and extract sub-fields into the top-level of results by using the
:pipeline:`$project` pipeline operator.

See :pipeline:`$project` for more information as well as
:doc:`/reference/aggregation` for more information on all the
available pipeline operators.
agg4: |
Returns results inline.

The result is subject to the :ref:`BSON Document size
<limit-bson-document-size>` limit.
agg5: Supports non-sharded and sharded input collections.
agg7: |
See :doc:`/core/aggregation` and :dbcommand:`aggregate`.
...
13 changes: 13 additions & 0 deletions source/reference/aggregation-commands-overview.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
===================================
Aggregation Commands Overview Chart
===================================

.. default-domain:: mongodb

MongoDB provides the :dbcommand:`aggregate`, :dbcommand:`mapReduce`, and
:dbcommand:`group` commands to perform aggregations.

The following table provides a brief overview of the features of the
commands.

.. include:: /includes/table-aggregation-xref.rst