Skip to content

DOCSP-50751: agg tutorial link #235

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
merged 3 commits into from
Jun 23, 2025
Merged
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
38 changes: 27 additions & 11 deletions source/fundamentals/aggregation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,33 @@ Aggregation
Overview
--------

In this guide, you can learn how to use **aggregation operations** in the MongoDB Kotlin driver.
In this guide, you can learn how to use **aggregation operations** in
the {+driver-short+}.

Aggregation operations process data in your MongoDB collections and return computed results. MongoDB's Aggregation
pipeline, part of the Query API, is modeled on the concept of data processing pipelines. Documents enter a multi-staged pipeline that
transforms the documents into an aggregated result.
Aggregation operations process data in your MongoDB collections and
return computed results. MongoDB's aggregation pipeline, which is part of the
Query API, is modeled on the concept of data-processing pipelines.
Documents enter a multi-stage pipeline that transforms the documents
into an aggregated result.

Another way to think of aggregation is like a car factory. Within the car factory is an assembly line, along which
are assembly stations with specialized tools to do a specific job, like drills and welders. Raw parts enter the factory,
which are then transformed and assembled into a finished product.
.. sharedinclude:: dbx/agg-tutorials-manual-tip.rst

The **aggregation pipeline** is the assembly line, **aggregation stages** are the assembly stations, and
**operator expressions** are the specialized tools.
.. replacement:: language

:guilabel:`{+language+} (Coroutine)`

Analogy
~~~~~~~

The functionality of an aggregation is similar to what occurs in a car
factory. Within the car factory is an assembly line, along which are
assembly stations with specialized tools to do a specific job, like
drills and welders. Raw parts enter the factory, and the factory
transforms them and assembles them into a finished product.

The **aggregation pipeline** is the assembly line, **aggregation
stages** are the assembly stations, and **operator expressions** are the
specialized tools.

Aggregation and Find Operations Compared
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -113,9 +128,10 @@ In the following example, the aggregation pipeline:
- Uses a :manual:`$group </reference/operator/aggregation/group/>` stage to group the matching documents by the ``stars``
field, accumulating a count of documents for each distinct value of ``stars``.

.. seealso::
.. tip::

You can build the expressions used in this example using the :ref:`aggregation builders <aggregates-builders>`.
You can build the expressions used in this example by using the
:ref:`aggregation builders <aggregates-builders>`.

.. io-code-block::

Expand Down
Loading