Skip to content

Commit 407876e

Browse files
committed
DOCSP-50752: agg tutorial link (#1167)
* DOCSP-50752: agg tutorial link * shift redirects * shift redirects * shift redirects (cherry picked from commit c2de22c) (cherry picked from commit c60b569)
1 parent 084c17d commit 407876e

File tree

9 files changed

+18
-1243
lines changed

9 files changed

+18
-1243
lines changed

snooty.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,25 @@ intersphinx = [
99
toc_landing_pages = [
1010
"/get-started",
1111
"/connect",
12-
"/aggregation",
1312
"/security",
1413
"/security/authentication",
1514
"/data-formats",
1615
"/connect/connection-options",
1716
"/crud",
1817
"/crud/update",
1918
"/crud/transactions",
20-
"/monitoring-and-logging"
19+
"/monitoring-and-logging",
2120
]
2221
sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/"
2322

2423
[constants]
25-
version = "6.15"
24+
2625
api = "https://mongodb.github.io/node-mongodb-native/{+version+}"
2726
driver-long = "MongoDB Node.js driver"
2827
driver-short = "Node.js driver"
2928
mdb-server = "MongoDB Server"
3029
min-node-version = "v16.20.1"
3130
stable-api = "Stable API"
31+
vector-search = "Atlas Vector Search"
32+
language = "JavaScript"
33+
environment = "Node.js"

source/aggregation.txt

Lines changed: 8 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@ Aggregation
1515
:depth: 2
1616
:class: singlecol
1717

18-
.. toctree::
19-
20-
Filtered Subset </aggregation/filtered-subset/>
21-
Group & Total </aggregation/group-total/>
22-
Unpack Arrays & Group </aggregation/unpack-arrays/>
23-
One-to-One Join </aggregation/one-to-one-join/>
24-
Multi-Field Join </aggregation/multi-field-join/>
25-
2618
.. _nodejs-aggregation-overview:
2719

2820
Overview
@@ -36,6 +28,14 @@ and summarized results in MongoDB. MongoDB's aggregation framework
3628
allows you to create a pipeline that consists of one or more stages,
3729
each of which performs a specific operation on your data.
3830

31+
.. _node-aggregation-tutorials:
32+
33+
.. sharedinclude:: dbx/agg-tutorials-manual-tip.rst
34+
35+
.. replacement:: language
36+
37+
:guilabel:`{+environment+}`
38+
3939
Analogy
4040
~~~~~~~
4141

@@ -143,112 +143,9 @@ This example produces the following output:
143143

144144
For more information, see the `aggregate() API documentation <{+api+}/classes/Collection.html#aggregate>`__.
145145

146-
.. _node-aggregation-tutorials-landing:
147-
.. _node-aggregation-tutorials:
148-
149-
Aggregation Tutorials
150-
---------------------
151-
152-
Aggregation tutorials provide detailed explanations of common
153-
aggregation tasks in a step-by-step format. The tutorials are adapted
154-
from examples in the `Practical MongoDB Aggregations book
155-
<https://www.practical-mongodb-aggregations.com/>`__ by Paul Done.
156-
157-
Each tutorial includes the following sections:
158-
159-
- **Introduction**, which describes the purpose and common use cases of the
160-
aggregation type. This section also describes the example and desired
161-
outcome that the tutorial demonstrates.
162-
163-
- **Before You Get Started**, which describes the necessary databases,
164-
collections, and sample data that you must have before building the
165-
aggregation pipeline and performing the aggregation.
166-
167-
- **Tutorial**, which describes how to build and run the aggregation
168-
pipeline. This section describes each stage of the completed
169-
aggregation tutorial, and then explains how to run and interpret the
170-
output of the aggregation.
171-
172-
At the end of each aggregation tutorial, you can find a link to a fully
173-
runnable Node.js code file that you can run in your environment.
174-
175-
.. tip::
176-
177-
To learn more about performing aggregations, see the
178-
:ref:`node-aggregation` guide.
179-
180-
.. _node-agg-tutorial-template-app:
181-
182-
Aggregation Template App
183-
~~~~~~~~~~~~~~~~~~~~~~~~
184-
185-
Before you begin following an aggregation tutorial, you must set up a
186-
new Node.js app. You can use this app to connect to a MongoDB
187-
deployment, insert sample data into MongoDB, and run the aggregation
188-
pipeline in each tutorial.
189-
190-
.. tip::
191-
192-
To learn how to install the driver and connect to MongoDB,
193-
see the :ref:`node-get-started-download-and-install` and
194-
:ref:`node-get-started-create-deployment` steps of the
195-
Quick Start guide.
196-
197-
Once you install the driver, create a file called
198-
``agg_tutorial.js``. Paste the following code in this file to create an
199-
app template for the aggregation tutorials:
200-
201-
.. literalinclude:: /includes/aggregation/template-app.js
202-
:language: javascript
203-
:copyable: true
204-
205-
.. important::
206-
207-
In the preceding code, read the code comments to find the sections of
208-
the code that you must modify for the tutorial you are following.
209-
210-
If you attempt to run the code without making any changes, you will
211-
encounter a connection error.
212-
213-
For every tutorial, you must replace the connection string placeholder with
214-
your deployment's connection string.
215-
216-
.. tip::
217-
218-
To learn how to locate your deployment's connection string, see the
219-
:ref:`node-get-started-connection-string` step of the Quick Start guide.
220-
221-
For example, if your connection string is
222-
``"mongodb+srv://mongodb-example:27017"``, your connection string assignment resembles
223-
the following:
224-
225-
.. code-block:: javascript
226-
:copyable: false
227-
228-
const uri = "mongodb+srv://mongodb-example:27017";
229-
230-
To run the completed file after you modify the template for a
231-
tutorial, run the following command in your shell:
232-
233-
.. code-block:: bash
234-
235-
node agg_tutorial.js
236-
237-
Available Tutorials
238-
~~~~~~~~~~~~~~~~~~~
239-
240-
- :ref:`node-aggregation-filtered-subset`
241-
- :ref:`node-aggregation-group-total`
242-
- :ref:`node-aggregation-arrays`
243-
- :ref:`node-aggregation-one-to-one`
244-
- :ref:`node-aggregation-multi-field`
245-
246146
Additional Examples
247147
~~~~~~~~~~~~~~~~~~~
248148

249-
To view step-by-step explanations of common aggregation tasks, see the
250-
:ref:`node-aggregation-tutorials-landing`.
251-
252149
You can find another aggregation pipeline example in the `Aggregation
253150
Framework with Node.js Tutorial
254151
<https://www.mongodb.com/blog/post/quick-start-nodejs--mongodb--how-to-analyze-data-using-the-aggregation-framework>`_

source/aggregation/filtered-subset.txt

Lines changed: 0 additions & 195 deletions
This file was deleted.

0 commit comments

Comments
 (0)