Skip to content

Commit 2c34f85

Browse files
committed
DOCSP-50497 fixing pages, removing comments, and finishing outline
1 parent 1cb3de7 commit 2c34f85

File tree

2 files changed

+49
-65
lines changed

2 files changed

+49
-65
lines changed

source/aggregation.txt

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ computed results. The MongoDB Aggregation framework is modeled on the
4141
concept of data processing pipelines. Documents enter a pipeline comprised of one or
4242
more stages, and this pipeline transforms the documents into an aggregated result.
4343

44-
To learn more about the aggregation stages supported by the Node.js Driver, see :ref:`Aggregation Stages <>`.
45-
.. todo-- add link here
44+
To learn more about the aggregation stages supported by the Node.js Driver, see :ref:`Aggregation Stages <node-aggregation-pipeline-stages>`.
4645

4746
Analogy
4847
~~~~~~~
@@ -102,72 +101,12 @@ Consider the following :manual:`limitations </core/aggregation-pipeline-limits/>
102101
property of the ``AggregateOptions`` object that you pass to the
103102
``Aggregate()`` method.
104103

105-
..
106-
Aggregation Example
107-
-------------------
108-
..
109-
To perform an aggregation, pass a list of aggregation stages to the
110-
``collection.aggregate()`` method.
111-
..
112-
.. note::
113-
..
114-
This example uses the ``sample_restaurants.restaurants`` collection
115-
from the :atlas:`Atlas sample datasets </sample-data>`. To learn how to create a
116-
free MongoDB Atlas cluster and load the sample datasets, see the :ref:`Get Started <node-get-started>` guide.
117-
..
118-
The following code example produces a count of the number of bakeries in each borough
119-
of New York City. To do so, the aggregation pipeline uses the following aggregation stages:
120-
..
121-
- A :manual:`$match </reference/operator/aggregation/match/>` stage to filter
122-
for documents whose ``cuisine`` field contains the element ``Bakery``.
123-
..
124-
- A :manual:`$group </reference/operator/aggregation/group/>` stage to group the
125-
matching documents by the ``borough`` field, accumulating a count of documents
126-
for each distinct value in the ``borough`` field.
127-
..
128-
.. literalinclude:: /code-snippets/aggregation/agg.js
129-
:start-after: begin aggregation
130-
:end-before: end aggregation
131-
:language: javascript
132-
:dedent:
133-
..
134-
This example produces the following output:
135-
..
136-
.. code-block:: json
137-
:copyable: false
138-
..
139-
{ _id = 'Bronx', count = 71 }
140-
{ _id = 'Brooklyn', count = 173 }
141-
{ _id = 'Staten Island', count = 20 }
142-
{ _id = 'Missing', count = 2 }
143-
{ _id = 'Manhattan', count = 221 }
144-
{ _id = 'Queens', count = 204 }
145-
146104
Additional information
147105
----------------------
148106

149107
To view a full list of expression operators, see
150108
:manual:`Aggregation Operators </reference/operator/aggregation/>`.
151109

152-
..
153-
To learn more about assembling an aggregation pipeline and view examples, see
154-
:manual:`Aggregation Pipeline </core/aggregation-pipeline/>`.
155-
..
156-
To learn more about creating pipeline stages and view examples, see
157-
:manual:`Aggregation Stages </reference/operator/aggregation-pipeline/>`.
158-
159110
To learn about explaining MongoDB aggregation operations, see
160111
:manual:`Explain Results </reference/explain-results/>` and
161112
:manual:`Query Plans </core/query-plans/>`.
162-
163-
..
164-
API Documentation
165-
~~~~~~~~~~~~~~~~~
166-
..
167-
For more information about the aggregation operations discussed in this guide, see the
168-
following API documentation:
169-
..
170-
- `Collection() <https://mongodb.github.io/node-mongodb-native/6.17/classes/Collection.html>`__
171-
- `aggregate() <https://mongodb.github.io/node-mongodb-native/6.17/classes/Collection.html#aggregate>`__
172-
- `AggregateOptions <https://mongodb.github.io/node-mongodb-native/6.17/interfaces/AggregateOptions.html>`__
173-
.. try to find $match and $group api links ..

source/aggregation/pipeline-stages.txt

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,39 @@ Build an Aggregation Pipeline
3030
You can use the {+driver-short+} to build an aggregation pipeline by INSERT
3131
HERE. See the following sections to learn more about each of these approaches.
3232

33-
.. to do these sections
33+
.. note::
34+
..
35+
This example uses the ``sample_restaurants.restaurants`` collection
36+
from the :atlas:`Atlas sample datasets </sample-data>`. To learn how to create a
37+
free MongoDB Atlas cluster and load the sample datasets, see the :ref:`Get Started <node-get-started>` guide.
38+
39+
The following code example produces a count of the number of bakeries in each borough
40+
of New York City. To do so, the aggregation pipeline uses the following aggregation stages:
41+
42+
- A :manual:`$match </reference/operator/aggregation/match/>` stage to filter
43+
for documents whose ``cuisine`` field contains the element ``Bakery``.
44+
- A :manual:`$group </reference/operator/aggregation/group/>` stage to group the
45+
matching documents by the ``borough`` field, accumulating a count of documents
46+
for each distinct value in the ``borough`` field.
47+
48+
.. literalinclude:: /code-snippets/aggregation/agg.js
49+
:start-after: begin aggregation
50+
:end-before: end aggregation
51+
:language: javascript
52+
:dedent:
53+
54+
This example produces the following output:
55+
56+
.. code-block:: json
57+
:copyable: false
58+
59+
{ _id = 'Bronx', count = 71 }
60+
{ _id = 'Brooklyn', count = 173 }
61+
{ _id = 'Staten Island', count = 20 }
62+
{ _id = 'Missing', count = 2 }
63+
{ _id = 'Manhattan', count = 221 }
64+
{ _id = 'Queens', count = 204 }
65+
3466

3567
Aggregation Stage Methods
3668
-------------------------
@@ -42,9 +74,9 @@ stage name to its reference page in the {+mdb-server+} manual.
4274

4375
.. list-table::
4476
:header-rows: 1
45-
:widths: 50 50
77+
:widths: 20 80
4678

47-
* - Aggregation Stage
79+
* - Stage
4880
- Description
4981

5082
* - :manual:`$bucket </reference/operator/aggregation/bucket/>`
@@ -235,5 +267,18 @@ stage name to its reference page in the {+mdb-server+} manual.
235267
available for self-managed deployments. To learn more, see
236268
:ref:`Atlas Vector Search <csharp-atlas-vector-search>`.
237269

270+
API Documentation
271+
~~~~~~~~~~~~~~~~~
272+
273+
To learn more about assembling an aggregation pipeline, see :manual:`Aggregation
274+
Pipeline </core/aggregation-pipeline/>` in the MongoDB Server manual.
275+
276+
To learn more about creating pipeline stages, see :manual:`Aggregation Stages
277+
</reference/operator/aggregation-pipeline/>` in the MongoDB Server manual.
238278

279+
For more information about the methods and classes used on this page, see the
280+
following API documentation:
239281

282+
- `Collection() <https://mongodb.github.io/node-mongodb-native/6.17/classes/Collection.html>`__
283+
- `aggregate() <https://mongodb.github.io/node-mongodb-native/6.17/classes/Collection.html#aggregate>`__
284+
- `AggregateOptions <https://mongodb.github.io/node-mongodb-native/6.17/interfaces/AggregateOptions.html>`__

0 commit comments

Comments
 (0)