Skip to content

Commit c60b569

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)
1 parent fcdf959 commit c60b569

File tree

10 files changed

+32
-1245
lines changed

10 files changed

+32
-1245
lines changed

config/redirects

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
define: prefix docs/drivers/node
22
define: base https://www.mongodb.com/${prefix}
3+
define: server https://www.mongodb.com/docs/manual
34
define: versions v3.6 v3.7 v4.0 v4.1 v4.2 v4.3 v4.4 v4.5 v4.6 v4.7 v4.8 v4.9 v4.10 v4.11 v4.12 v4.13 v4.14 v4.15 v4.16 v4.17 v5.0 v5.1 v5.2 v5.3 v5.4 v5.5 v5.6 v5.7 v5.8 v5.9 v6.0 v6.1 v6.2 v6.3 v6.4 v6.5 v6.6 v6.7 v6.8 v6.9 v6.10 v6.11 v6.12 v6.13 v6.14 v6.15 v6.16 master
45

56
symlink: current -> master
@@ -104,4 +105,18 @@ raw: ${prefix}/stable -> ${base}/current/
104105
[v6.16-master]: ${prefix}/${version}/usage-examples/bulkWrite/ -> ${base}/${version}/bulk-write/
105106
[v6.16-master]: ${prefix}/${version}/usage-examples/transactions/ -> ${base}/${version}/crud/transactions/
106107
[v6.16-master]: ${prefix}/${version}/usage-examples/transaction-conv/ -> ${base}/${version}/crud/transactions/transaction-conv/
107-
[v6.16-master]: ${prefix}/${version}/usage-examples/transaction-core/ -> ${base}/${version}/crud/transactions/transaction-core/
108+
[v6.16-master]: ${prefix}/${version}/usage-examples/transaction-core/ -> ${base}/${version}/crud/transactions/transaction-core/
109+
110+
## Aggregation Tutorials Redirects
111+
112+
[v6.5-master]: ${prefix}/${version}/aggregation-tutorials/ -> ${server}/tutorial/aggregation-complete-examples/
113+
[v6.5-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/filtered-subset/ -> ${server}/tutorial/aggregation-examples/filtered-subset/
114+
[v6.5-master]: ${prefix}/${version}/aggregation/filtered-subset/ -> ${server}/tutorial/aggregation-examples/filtered-subset/
115+
[v6.5-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/group-total/ -> ${server}/tutorial/aggregation-examples/group-and-total/
116+
[v6.5-master]: ${prefix}/${version}/aggregation/group-total/ -> ${server}/tutorial/aggregation-examples/group-and-total/
117+
[v6.5-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/multi-field-join/ -> ${server}/tutorial/aggregation-examples/multi-field-join/
118+
[v6.5-master]: ${prefix}/${version}/aggregation/multi-field-join/ -> ${server}/tutorial/aggregation-examples/multi-field-join/
119+
[v6.5-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/one-to-one-join/ -> ${server}/tutorial/aggregation-examples/one-to-one-join/
120+
[v6.5-master]: ${prefix}/${version}/aggregation/one-to-one-join/ -> ${server}/tutorial/aggregation-examples/one-to-one-join/
121+
[v6.5-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/unpack-arrays/ -> ${server}/tutorial/aggregation-examples/unpack-arrays/
122+
[v6.5-master]: ${prefix}/${version}/aggregation/unpack-arrays/ -> ${server}/tutorial/aggregation-examples/unpack-arrays/

snooty.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ intersphinx = [
99
toc_landing_pages = [
1010
"/get-started",
1111
"/connect",
12-
"/aggregation",
13-
"/aggregation/aggregation-tutorials",
1412
"/security",
1513
"/security/authentication",
1614
"/aggregation-tutorials",
@@ -20,7 +18,7 @@ toc_landing_pages = [
2018
"/crud/query",
2119
"crud/update",
2220
"/crud/transactions",
23-
"/monitoring-and-logging"
21+
"/monitoring-and-logging",
2422
]
2523
sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/"
2624

@@ -33,4 +31,5 @@ mdb-server = "MongoDB Server"
3331
min-node-version = "v16.20.1"
3432
stable-api = "Stable API"
3533
vector-search = "Atlas Vector Search"
36-
language = "JavaScript"
34+
language = "JavaScript"
35+
environment = "Node.js"

source/aggregation.txt

Lines changed: 8 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ Aggregation
1818
:depth: 2
1919
:class: singlecol
2020

21-
.. toctree::
22-
23-
Filtered Subset </aggregation/filtered-subset/>
24-
Group & Total </aggregation/group-total/>
25-
Unpack Arrays & Group </aggregation/unpack-arrays/>
26-
One-to-One Join </aggregation/one-to-one-join/>
27-
Multi-Field Join </aggregation/multi-field-join/>
28-
2921
.. _nodejs-aggregation-overview:
3022

3123
Overview
@@ -39,6 +31,14 @@ and summarized results in MongoDB. MongoDB's aggregation framework
3931
allows you to create a pipeline that consists of one or more stages,
4032
each of which performs a specific operation on your data.
4133

34+
.. _node-aggregation-tutorials:
35+
36+
.. sharedinclude:: dbx/agg-tutorials-manual-tip.rst
37+
38+
.. replacement:: language
39+
40+
:guilabel:`{+environment+}`
41+
4242
Analogy
4343
~~~~~~~
4444

@@ -146,112 +146,9 @@ This example produces the following output:
146146

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

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

252-
To view step-by-step explanations of common aggregation tasks, see the
253-
:ref:`node-aggregation-tutorials-landing`.
254-
255152
You can find another aggregation pipeline example in the `Aggregation
256153
Framework with Node.js Tutorial
257154
<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)