From 0b25491aadfe36d8f4427dfedfecaf865d1efe78 Mon Sep 17 00:00:00 2001 From: rustagir Date: Wed, 18 Jun 2025 14:34:28 -0400 Subject: [PATCH 1/4] DOCSP-50752: agg tutorial link --- config/redirects | 23 +- snooty.toml | 7 +- source/aggregation.txt | 119 +------- source/aggregation/filtered-subset.txt | 195 ------------- source/aggregation/group-total.txt | 229 --------------- source/aggregation/multi-field-join.txt | 260 ------------------ source/aggregation/one-to-one-join.txt | 229 --------------- source/aggregation/unpack-arrays.txt | 210 -------------- source/connect/connection-options.txt | 8 +- .../monitoring-and-logging/change-streams.txt | 4 +- 10 files changed, 32 insertions(+), 1252 deletions(-) delete mode 100644 source/aggregation/filtered-subset.txt delete mode 100644 source/aggregation/group-total.txt delete mode 100644 source/aggregation/multi-field-join.txt delete mode 100644 source/aggregation/one-to-one-join.txt delete mode 100644 source/aggregation/unpack-arrays.txt diff --git a/config/redirects b/config/redirects index 04bbec109..3863be263 100644 --- a/config/redirects +++ b/config/redirects @@ -1,5 +1,6 @@ define: prefix docs/drivers/node define: base https://www.mongodb.com/${prefix} +define: server https://www.mongodb.com/docs/manual 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 v6.17 master symlink: current -> master @@ -65,12 +66,20 @@ raw: ${prefix}/stable -> ${base}/current/ [v6.5-master]: ${prefix}/${version}/fundamentals/logging/ -> ${base}/${version}/monitoring-and-logging/logging/ [v6.5-master]: ${prefix}/${version}/usage-examples/changeStream -> ${base}/monitoring-and-logging/change-streams/ [v6.5-master]: ${prefix}/${version}/fundamentals/aggregation/ -> ${base}/${version}/aggregation/ -[v6.5-master]: ${prefix}/${version}/aggregation-tutorials/ -> ${base}/${version}/aggregation/ -[v6.5-master]: ${prefix}/${version}/aggregation-tutorials/filtered-subset/ -> ${base}/${version}/aggregation/filtered-subset/ -[v6.5-master]: ${prefix}/${version}/aggregation-tutorials/group-total/ -> ${base}/${version}/aggregation/group-total/ -[v6.5-master]: ${prefix}/${version}/aggregation-tutorials/multi-field-join/ -> ${base}/${version}/aggregation/multi-field-join/ -[v6.5-master]: ${prefix}/${version}/aggregation-tutorials/one-to-one-join/ -> ${base}/${version}/aggregation/one-to-one-join/ -[v6.5-master]: ${prefix}/${version}/aggregation-tutorials/unpack-arrays/ -> ${base}/${version}/aggregation/unpack-arrays/ + +## Aggregation Tutorials Redirects + +[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/filtered-subset/ -> ${server}/tutorial/aggregation-examples/filtered-subset/ +[*-master]: ${prefix}/${version}/aggregation/filtered-subset/ -> ${server}/tutorial/aggregation-examples/filtered-subset/ +[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/group-total/ -> ${server}/tutorial/aggregation-examples/group-and-total/ +[*-master]: ${prefix}/${version}/aggregation/group-total/ -> ${server}/tutorial/aggregation-examples/group-and-total/ +[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/multi-field-join/ -> ${server}/tutorial/aggregation-examples/multi-field-join/ +[*-master]: ${prefix}/${version}/aggregation/multi-field-join/ -> ${server}/tutorial/aggregation-examples/multi-field-join/ +[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/one-to-one-join/ ->${server}/tutorial/aggregation-examples/one-to-one-join/ +[*-master]: ${prefix}/${version}/aggregation/one-to-one-join/ -> ${server}/tutorial/aggregation-examples/one-to-one-join/ +[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/unpack-arrays/ -> ${server}/tutorial/aggregation-examples/unpack-arrays/ +[*-master]: ${prefix}/${version}/aggregation/unpack-arrays/ -> ${server}/tutorial/aggregation-examples/unpack-arrays/ + [v6.5-master]: ${prefix}/${version}/fundamentals/authentication -> ${base}/${version}/security/authentication/ [v6.5-v6.15]: ${prefix}/${version}/fundamentals/authentication/mechanisms/ -> ${base}/${version}/security/authentication/mechanisms/ @@ -115,4 +124,4 @@ raw: ${prefix}/stable -> ${base}/current/ [v6.16-master]: ${prefix}/${version}/usage-examples/bulkWrite/ -> ${base}/${version}/bulk-write/ [v6.16-master]: ${prefix}/${version}/usage-examples/transactions/ -> ${base}/${version}/crud/transactions/ [v6.16-master]: ${prefix}/${version}/usage-examples/transaction-conv/ -> ${base}/${version}/crud/transactions/transaction-conv/ -[v6.16-master]: ${prefix}/${version}/usage-examples/transaction-core/ -> ${base}/${version}/crud/transactions/transaction-core/ \ No newline at end of file +[v6.16-master]: ${prefix}/${version}/usage-examples/transaction-core/ -> ${base}/${version}/crud/transactions/transaction-core/ diff --git a/snooty.toml b/snooty.toml index 60bf6cadb..55b428e51 100644 --- a/snooty.toml +++ b/snooty.toml @@ -9,8 +9,6 @@ intersphinx = [ toc_landing_pages = [ "/get-started", "/connect", - "/aggregation", - "/aggregation/aggregation-tutorials", "/security", "/security/authentication", "/aggregation-tutorials", @@ -20,7 +18,7 @@ toc_landing_pages = [ "/crud/query", "crud/update", "/crud/transactions", - "/monitoring-and-logging" + "/monitoring-and-logging", ] sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/" @@ -33,4 +31,5 @@ mdb-server = "MongoDB Server" min-node-version = "v16.20.1" stable-api = "Stable API" vector-search = "Atlas Vector Search" -language = "JavaScript" \ No newline at end of file +language = "JavaScript" +environment = "Node.js" diff --git a/source/aggregation.txt b/source/aggregation.txt index c4f2504e4..eafa24d31 100644 --- a/source/aggregation.txt +++ b/source/aggregation.txt @@ -18,14 +18,6 @@ Aggregation :depth: 2 :class: singlecol -.. toctree:: - - Filtered Subset - Group & Total - Unpack Arrays & Group - One-to-One Join - Multi-Field Join - .. _nodejs-aggregation-overview: Overview @@ -39,6 +31,14 @@ and summarized results in MongoDB. MongoDB's aggregation framework allows you to create a pipeline that consists of one or more stages, each of which performs a specific operation on your data. +.. _node-aggregation-tutorials: + +.. sharedinclude:: dbx/agg-tutorials-manual-tip.rst + + .. replacement:: language + + :guilabel:`{+environment+}` + Analogy ~~~~~~~ @@ -146,112 +146,9 @@ This example produces the following output: For more information, see the `aggregate() API documentation <{+api+}/classes/Collection.html#aggregate>`__. -.. _node-aggregation-tutorials-landing: -.. _node-aggregation-tutorials: - -Aggregation Tutorials ---------------------- - -Aggregation tutorials provide detailed explanations of common -aggregation tasks in a step-by-step format. The tutorials are adapted -from examples in the `Practical MongoDB Aggregations book -`__ by Paul Done. - -Each tutorial includes the following sections: - -- **Introduction**, which describes the purpose and common use cases of the - aggregation type. This section also describes the example and desired - outcome that the tutorial demonstrates. - -- **Before You Get Started**, which describes the necessary databases, - collections, and sample data that you must have before building the - aggregation pipeline and performing the aggregation. - -- **Tutorial**, which describes how to build and run the aggregation - pipeline. This section describes each stage of the completed - aggregation tutorial, and then explains how to run and interpret the - output of the aggregation. - -At the end of each aggregation tutorial, you can find a link to a fully -runnable Node.js code file that you can run in your environment. - -.. tip:: - - To learn more about performing aggregations, see the - :ref:`node-aggregation` guide. - -.. _node-agg-tutorial-template-app: - -Aggregation Template App -~~~~~~~~~~~~~~~~~~~~~~~~ - -Before you begin following an aggregation tutorial, you must set up a -new Node.js app. You can use this app to connect to a MongoDB -deployment, insert sample data into MongoDB, and run the aggregation -pipeline in each tutorial. - -.. tip:: - - To learn how to install the driver and connect to MongoDB, - see the :ref:`node-get-started-download-and-install` and - :ref:`node-get-started-create-deployment` steps of the - Quick Start guide. - -Once you install the driver, create a file called -``agg_tutorial.js``. Paste the following code in this file to create an -app template for the aggregation tutorials: - -.. literalinclude:: /includes/aggregation/template-app.js - :language: javascript - :copyable: true - -.. important:: - - In the preceding code, read the code comments to find the sections of - the code that you must modify for the tutorial you are following. - - If you attempt to run the code without making any changes, you will - encounter a connection error. - -For every tutorial, you must replace the connection string placeholder with -your deployment's connection string. - -.. tip:: - - To learn how to locate your deployment's connection string, see the - :ref:`node-get-started-connection-string` step of the Quick Start guide. - -For example, if your connection string is -``"mongodb+srv://mongodb-example:27017"``, your connection string assignment resembles -the following: - -.. code-block:: javascript - :copyable: false - - const uri = "mongodb+srv://mongodb-example:27017"; - -To run the completed file after you modify the template for a -tutorial, run the following command in your shell: - -.. code-block:: bash - - node agg_tutorial.js - -Available Tutorials -~~~~~~~~~~~~~~~~~~~ - -- :ref:`node-aggregation-filtered-subset` -- :ref:`node-aggregation-group-total` -- :ref:`node-aggregation-arrays` -- :ref:`node-aggregation-one-to-one` -- :ref:`node-aggregation-multi-field` - Additional Examples ~~~~~~~~~~~~~~~~~~~ -To view step-by-step explanations of common aggregation tasks, see the -:ref:`node-aggregation-tutorials-landing`. - You can find another aggregation pipeline example in the `Aggregation Framework with Node.js Tutorial `_ diff --git a/source/aggregation/filtered-subset.txt b/source/aggregation/filtered-subset.txt deleted file mode 100644 index 9549a15eb..000000000 --- a/source/aggregation/filtered-subset.txt +++ /dev/null @@ -1,195 +0,0 @@ -.. _node-aggregation-filtered-subset: - -=============== -Filtered Subset -=============== - -.. contents:: On this page - :local: - :backlinks: none - :depth: 2 - :class: singlecol - -.. facet:: - :name: genre - :values: tutorial - -.. meta:: - :keywords: code example, node.js, sort, limit, aggregation - :description: Learn to use the MongoDB Node.js Driver to create an aggregation pipeline that filters, sorts, and formats a subset of documents in a MongoDB collection. - -Introduction ------------- - -In this tutorial, you can learn how to use the {+driver-short+} to -construct an aggregation pipeline, perform the -aggregation on a collection, and print the results by completing and -running a sample app. This aggregation performs the following operations: - -- Matches a subset of documents by a field value -- Formats result documents - -.. tip:: - - You can also query for a subset of documents in a collection by using the - Query API. To learn how to specify a query, see the - :ref:`Read Operations guides `. - -Aggregation Task Summary -~~~~~~~~~~~~~~~~~~~~~~~~ - -This tutorial demonstrates how to query a collection for a specific -subset of documents in a collection. The results contain -documents that describe the three youngest people who are engineers. - -This example uses one collection, ``persons``, which contains -documents describing people. Each document includes a person's name, -date of birth, vocation, and other details. - -Before You Get Started ----------------------- - -Before you start this tutorial, complete the -:ref:`node-agg-tutorial-template-app` instructions to set up a working -Node.js application. - -After you set up the app, access the ``persons`` collection by adding the -following code to the application: - -.. literalinclude:: /includes/aggregation/filtered-subset.js - :language: javascript - :copyable: true - :start-after: start-collection - :end-before: end-collection - :dedent: - -Delete any existing data in the collections and insert sample data into -the ``persons`` collection as shown in the following code: - -.. literalinclude:: /includes/aggregation/filtered-subset.js - :language: javascript - :copyable: true - :start-after: start-insert-persons - :end-before: end-insert-persons - :dedent: - -Tutorial --------- - -.. procedure:: - :style: connected - - .. step:: Add a match stage for people who are engineers - - First, add a :manual:`$match - ` stage that finds documents in which - the value of the ``vocation`` field is ``"ENGINEER"``: - - .. literalinclude:: /includes/aggregation/filtered-subset.js - :language: javascript - :copyable: true - :start-after: start-match - :end-before: end-match - :dedent: - - .. step:: Add a sort stage to sort from youngest to oldest - - Next, add a :manual:`$sort - ` stage that sorts the - documents in descending order by the ``dateofbirth`` field to - list the youngest people first: - - .. literalinclude:: /includes/aggregation/filtered-subset.js - :language: javascript - :copyable: true - :start-after: start-sort - :end-before: end-sort - :dedent: - - .. step:: Add a limit stage to see only three results - - Next, add a :manual:`$limit ` - stage to the pipeline to output only the first three documents in - the results. - - .. literalinclude:: /includes/aggregation/filtered-subset.js - :language: javascript - :copyable: true - :start-after: start-limit - :end-before: end-limit - :dedent: - - .. step:: Add an unset stage to remove unneeded fields - - Finally, add an :manual:`$unset - ` stage. The - ``$unset`` stage removes unnecessary fields from the result documents: - - .. literalinclude:: /includes/aggregation/filtered-subset.js - :language: javascript - :copyable: true - :start-after: start-unset - :end-before: end-unset - :dedent: - - .. tip:: - - Use the ``$unset`` operator instead of ``$project`` to avoid - modifying the aggregation pipeline if documents with - different fields are added to the collection. - - .. step:: Run the aggregation pipeline - - Add the following code to the end of your application to perform - the aggregation on the ``persons`` collection: - - .. literalinclude:: /includes/aggregation/filtered-subset.js - :language: javascript - :copyable: true - :start-after: start-run-agg - :end-before: end-run-agg - :dedent: - - Finally, run the following command in your shell to start your - application: - - .. code-block:: bash - - node agg_tutorial.js - - .. step:: Interpret results - - The aggregated result contains three documents. The documents - represent the three youngest people with the vocation of ``"ENGINEER"``, - ordered from youngest to oldest. The results omit the ``_id`` and ``address`` - fields. - - .. code-block:: javascript - :copyable: false - - { - person_id: '7363626383', - firstname: 'Carl', - lastname: 'Simmons', - dateofbirth: 1998-12-26T13:13:55.000Z, - vocation: 'ENGINEER' - } - { - person_id: '1723338115', - firstname: 'Olive', - lastname: 'Ranieri', - dateofbirth: 1985-05-12T23:14:30.000Z, - gender: 'FEMALE', - vocation: 'ENGINEER' - } - { - person_id: '6392529400', - firstname: 'Elise', - lastname: 'Smith', - dateofbirth: 1972-01-13T09:32:07.000Z, - vocation: 'ENGINEER' - } - -To view the complete code for this tutorial, see the `Completed Filtered Subset App -`__ -on GitHub. \ No newline at end of file diff --git a/source/aggregation/group-total.txt b/source/aggregation/group-total.txt deleted file mode 100644 index 9bc66a784..000000000 --- a/source/aggregation/group-total.txt +++ /dev/null @@ -1,229 +0,0 @@ -.. _node-aggregation-group-total: - -=============== -Group and Total -=============== - -.. contents:: On this page - :local: - :backlinks: none - :depth: 2 - :class: singlecol - -.. facet:: - :name: genre - :values: tutorial - -.. meta:: - :keywords: code example, node.js, analyze, aggregation - :description: Learn to use the MongoDB Node.js Driver to construct an aggregation pipeline that groups and analyzes data. - -Introduction ------------- - -In this tutorial, you can learn how to use the {+driver-short+} to -construct an aggregation pipeline, perform the -aggregation on a collection, and print the results by completing and -running a sample app. This aggregation performs the following operations: - -- Matches a subset of documents by a field value -- Groups documents by common field values -- Adds computed fields to each result document - -Aggregation Task Summary -~~~~~~~~~~~~~~~~~~~~~~~~ - -This tutorial demonstrates how to group and analyze customer order data. The -results show the list of customers who purchased items in 2020 and -includes each customer's order history for 2020. - -This example uses one collection, ``orders``, which contains documents -describing individual product orders. Since each order can correspond to -only one customer, the order documents are grouped by the -``customer_id`` field, which contains customer email addresses. - -Before You Get Started ----------------------- - -Before you start this tutorial, complete the -:ref:`node-agg-tutorial-template-app` instructions to set up a working -Node.js application. - -After you set up the app, access the ``orders`` collection by adding the -following code to the application: - -.. literalinclude:: /includes/aggregation/group-total.js - :language: javascript - :copyable: true - :start-after: start-coll - :end-before: end-coll - :dedent: - -Delete any existing data and insert sample data into -the ``orders`` collection as shown in the following code: - -.. literalinclude:: /includes/aggregation/group-total.js - :language: javascript - :copyable: true - :start-after: start-insert-orders - :end-before: end-insert-orders - :dedent: - -Tutorial --------- - -.. procedure:: - :style: connected - - .. step:: Add a match stage for orders in 2020 - - First, add a :manual:`$match - ` stage that matches - orders placed in 2020: - - .. literalinclude:: /includes/aggregation/group-total.js - :language: javascript - :copyable: true - :start-after: start-match - :end-before: end-match - :dedent: - - .. step:: Add a sort stage to sort by order date - - Next, add a :manual:`$sort - ` stage to set an - ascending sort on the ``orderdate`` field to surface the earliest - 2020 purchase for each customer in the next stage: - - .. literalinclude:: /includes/aggregation/group-total.js - :language: javascript - :copyable: true - :start-after: start-sort1 - :end-before: end-sort1 - :dedent: - - .. step:: Add a group stage to group by email address - - Add a :manual:`$group - ` stage to group - orders by the value of the ``customer_id`` field. In this - stage, add aggregation operations that create the - following fields in the result documents: - - - ``first_purchase_date``: the date of the customer's first purchase - - ``total_value``: the total value of all the customer's purchases - - ``total_orders``: the total number of the customer's purchases - - ``orders``: the list of all the customer's purchases, - including the date and value of each purchase - - .. literalinclude:: /includes/aggregation/group-total.js - :language: javascript - :copyable: true - :start-after: start-group - :end-before: end-group - :dedent: - - .. step:: Add a sort stage to sort by first order date - - Next, add another :manual:`$sort - ` stage to set an - ascending sort on the ``first_purchase_date`` field: - - .. literalinclude:: /includes/aggregation/group-total.js - :language: javascript - :copyable: true - :start-after: start-sort2 - :end-before: end-sort2 - :dedent: - - .. step:: Add a set stage to display the email address - - Add a :manual:`$set - ` stage to recreate the - ``customer_id`` field from the values in the ``_id`` field - that were set during the ``$group`` stage: - - .. literalinclude:: /includes/aggregation/group-total.js - :language: javascript - :copyable: true - :start-after: start-set - :end-before: end-set - :dedent: - - .. step:: Add an unset stage to remove unneeded fields - - Finally, add an :manual:`$unset - ` stage. The - ``$unset`` stage removes the ``_id`` field from the result - documents: - - .. literalinclude:: /includes/aggregation/group-total.js - :language: javascript - :copyable: true - :start-after: start-unset - :end-before: end-unset - :dedent: - - .. step:: Run the aggregation pipeline - - Add the following code to the end of your application to perform - the aggregation on the ``orders`` collection: - - .. literalinclude:: /includes/aggregation/group-total.js - :language: javascript - :copyable: true - :start-after: start-run-agg - :end-before: end-run-agg - :dedent: - - Finally, run the following command in your shell to start your - application: - - .. code-block:: bash - - node agg_tutorial.js - - .. step:: Interpret results - - The aggregation returns the following summary of customers' orders - from 2020: - - .. code-block:: javascript - :copyable: false - - { - first_purchase_date: 2020-01-01T08:25:37.000Z, - total_value: 63, - total_orders: 1, - orders: [ { orderdate: 2020-01-01T08:25:37.000Z, value: 63 } ], - customer_id: 'oranieri@warmmail.com' - } - { - first_purchase_date: 2020-01-13T09:32:07.000Z, - total_value: 436, - total_orders: 4, - orders: [ - { orderdate: 2020-01-13T09:32:07.000Z, value: 99 }, - { orderdate: 2020-05-30T08:35:52.000Z, value: 231 }, - { orderdate: 2020-10-03T13:49:44.000Z, value: 102 }, - { orderdate: 2020-12-26T08:55:46.000Z, value: 4 } - ], - customer_id: 'elise_smith@myemail.com' - } - { - first_purchase_date: 2020-08-18T23:04:48.000Z, - total_value: 191, - total_orders: 2, - orders: [ - { orderdate: 2020-08-18T23:04:48.000Z, value: 4 }, - { orderdate: 2020-11-23T22:56:53.000Z, value: 187 } - ], - customer_id: 'tj@wheresmyemail.com' - } - - The result documents contain details from all the orders from - a given customer, grouped by the customer's email address. - -To view the complete code for this tutorial, see the `Completed Group and Total App -`__ -on GitHub. diff --git a/source/aggregation/multi-field-join.txt b/source/aggregation/multi-field-join.txt deleted file mode 100644 index 605676177..000000000 --- a/source/aggregation/multi-field-join.txt +++ /dev/null @@ -1,260 +0,0 @@ -.. _node-aggregation-multi-field: - -================ -Multi-Field Join -================ - -.. contents:: On this page - :local: - :backlinks: none - :depth: 2 - :class: singlecol - -.. facet:: - :name: genre - :values: tutorial - -.. meta:: - :keywords: code example, node.js, lookup, aggregation - :description: Learn to perform a multi-field join using the MongoDB Node.js Driver to combine data from two collections in an aggregation pipeline. - -Introduction ------------- - -In this tutorial, you can learn how to use the {+driver-short+} to -construct an aggregation pipeline, perform the -aggregation on a collection, and print the results by completing and -running a sample app. - -This aggregation performs a multi-field join. A multi-field join occurs when there are -multiple corresponding fields in the documents of two collections that you use to -match documents together. The aggregation matches these documents on the -field values and combines information from both into one document. - -.. tip:: One-to-many Joins - - A one-to-many join is a variety of a multi-field join. When you - perform a one-to-many join, you select one field from a document that - matches a field value in multiple documents on the other side of the - join. To learn more about these data relationships, - see the Wikipedia entries about :wikipedia:`One-to-many (data model) - ` and - :wikipedia:`Many-to-many (data model) - `. - -Aggregation Task Summary -~~~~~~~~~~~~~~~~~~~~~~~~ - -This tutorial demonstrates how to combine data from a collection that -describes product information with another collection that describes -customer orders. The results show a list of products ordered in 2020 -that also contains details about each order. - -This example uses two collections: - -- ``products``, which contains documents describing the products that - a shop sells -- ``orders``, which contains documents describing individual orders - for products in a shop - -An order can only contain one product, so the aggregation uses a -multi-field join to match a product document to documents representing orders of -that product. The collections are joined by the ``name`` and -``variation`` fields in documents in the ``products`` collection, corresponding -to the ``product_name`` and ``product_variation`` fields in documents in -the ``orders`` collection. - -Before You Get Started ----------------------- - -Before you start this tutorial, complete the -:ref:`node-agg-tutorial-template-app` instructions to set up a working -Node.js application. - -After you set up the app, access the ``products`` and ``orders`` -collections by adding the following code to the application: - -.. literalinclude:: /includes/aggregation/multi-field-join.js - :language: javascript - :copyable: true - :start-after: start-colls - :end-before: end-colls - :dedent: - -Delete any existing data and insert sample data into -the ``products`` collection as shown in the following code: - -.. literalinclude:: /includes/aggregation/multi-field-join.js - :language: javascript - :copyable: true - :start-after: start-insert-products - :end-before: end-insert-products - :dedent: - -Delete any existing data and insert sample data into -the ``orders`` collection as shown in the following code: - -.. literalinclude:: /includes/aggregation/multi-field-join.js - :language: javascript - :copyable: true - :start-after: start-insert-orders - :end-before: end-insert-orders - :dedent: - -Tutorial --------- - -.. procedure:: - :style: connected - - .. step:: Add a lookup stage to link the collections and import fields - - The first stage of the pipeline is a :manual:`$lookup - ` stage to join the - ``orders`` collection to the ``products`` collection by two - fields in each collection. The lookup stage contains an - embedded pipeline to configure the join. - - Within the embedded pipeline, add a :manual:`$match - ` stage to match the - values of two fields on each side of the join. Note that the following - code uses aliases for the ``name`` and ``variation`` fields - set when :ref:`creating the $lookup stage `: - - .. literalinclude:: /includes/aggregation/multi-field-join.js - :language: javascript - :copyable: true - :start-after: start-embedded-pl-match1 - :end-before: end-embedded-pl-match1 - :dedent: - - Within the embedded pipeline, add another :manual:`$match - ` stage to match - orders placed in 2020: - - .. literalinclude:: /includes/aggregation/multi-field-join.js - :language: javascript - :copyable: true - :start-after: start-embedded-pl-match2 - :end-before: end-embedded-pl-match2 - :dedent: - - Within the embedded pipeline, add an :manual:`$unset - ` stage to remove - unneeded fields from the ``orders`` collection side of the join: - - .. literalinclude:: /includes/aggregation/multi-field-join.js - :language: javascript - :copyable: true - :start-after: start-embedded-pl-unset - :end-before: end-embedded-pl-unset - :dedent: - - .. _node-multi-field-agg-lookup-stage: - - After the embedded pipeline is completed, add the - ``$lookup`` stage to the main aggregation pipeline. - Configure this stage to store the processed lookup fields in - an array field called ``orders``: - - .. literalinclude:: /includes/aggregation/multi-field-join.js - :language: javascript - :copyable: true - :start-after: start-lookup - :end-before: end-lookup - :dedent: - - .. step:: Add a match stage for products ordered in 2020 - - Next, add a :manual:`$match - ` stage to only show - products for which there is at least one order in 2020, - based on the ``orders`` array calculated in the previous step: - - .. literalinclude:: /includes/aggregation/multi-field-join.js - :language: javascript - :copyable: true - :start-after: start-match - :end-before: end-match - :dedent: - - .. step:: Add an unset stage to remove unneeded fields - - Finally, add an :manual:`$unset - ` stage. The - ``$unset`` stage removes the ``_id`` and ``description`` - fields from the result documents: - - .. literalinclude:: /includes/aggregation/multi-field-join.js - :language: javascript - :copyable: true - :start-after: start-unset - :end-before: end-unset - :dedent: - - .. step:: Run the aggregation pipeline - - Add the following code to the end of your application to perform - the aggregation on the ``products`` collection: - - .. literalinclude:: /includes/aggregation/multi-field-join.js - :language: javascript - :copyable: true - :start-after: start-run-agg - :end-before: end-run-agg - :dedent: - - Finally, run the following command in your shell to start your - application: - - .. code-block:: bash - - node agg_tutorial.js - - .. step:: Interpret results - - The aggregated result contains two documents. The documents - represent products for which there were orders placed in 2020. - Each document contains an ``orders`` array field that lists details - about each order for that product: - - .. code-block:: javascript - :copyable: false - - { - name: 'Asus Laptop', - variation: 'Standard Display', - category: 'ELECTRONICS', - orders: [ - { - customer_id: 'elise_smith@myemail.com', - orderdate: 2020-05-30T08:35:52.000Z, - value: 431.43 - }, - { - customer_id: 'jjones@tepidmail.com', - orderdate: 2020-12-26T08:55:46.000Z, - value: 429.65 - } - ] - } - { - name: 'Morphy Richards Food Mixer', - variation: 'Deluxe', - category: 'KITCHENWARE', - orders: [ - { - customer_id: 'oranieri@warmmail.com', - orderdate: 2020-01-01T08:25:37.000Z, - value: 63.13 - } - ] - } - - The result documents contain details from documents in the - ``orders`` collection and the ``products`` collection, joined by - the product names and variations. - -To view the complete code for this tutorial, see the `Completed Multi-field Join App -`__ -on GitHub. diff --git a/source/aggregation/one-to-one-join.txt b/source/aggregation/one-to-one-join.txt deleted file mode 100644 index e0b944a58..000000000 --- a/source/aggregation/one-to-one-join.txt +++ /dev/null @@ -1,229 +0,0 @@ -.. _node-aggregation-one-to-one: - -=============== -One-to-One Join -=============== - -.. contents:: On this page - :local: - :backlinks: none - :depth: 2 - :class: singlecol - -.. facet:: - :name: genre - :values: tutorial - -.. meta:: - :keywords: code example, node.js, lookup, aggregation - :description: Learn to perform a one-to-one join using the MongoDB Node.js Driver to combine data from two collections in an aggregation pipeline. - -Introduction ------------- - -In this tutorial, you can learn how to use the {+driver-short+} to -construct an aggregation pipeline, perform the -aggregation on a collection, and print the results by completing and -running a sample app. - -This aggregation performs a one-to-one join. A one-to-one join occurs -when a document in one collection has a field value that matches a -single document in another collection that has the same field value. The -aggregation matches these documents on the field value and combines -information from both sources into one result. - -.. tip:: - - A one-to-one join does not require the documents to have a - one-to-one relationship. To learn more about this data relationship, - see the Wikipedia entry about :wikipedia:`One-to-one (data model) - `. - -Aggregation Task Summary -~~~~~~~~~~~~~~~~~~~~~~~~ - -This tutorial demonstrates how to combine data from a collection that -describes product information with another collection that describes -customer orders. The results show a list of all orders placed in 2020 that -includes the product details associated with each order. - -This example uses two collections: - -- ``orders``: contains documents describing individual orders - for products in a shop -- ``products``: contains documents describing the products that - a shop sells - -An order can only contain one product, so the aggregation uses a -one-to-one join to match an order document to the document for the -product. The collections are joined by a field called ``product_id`` -that exists in documents in both collections. - -Before You Get Started ----------------------- - -Before you start this tutorial, complete the -:ref:`node-agg-tutorial-template-app` instructions to set up a working -Node.js application. - -After you set up the app, access the ``orders`` and ``products`` -collections by adding the following code to the application: - -.. literalinclude:: /includes/aggregation/one-to-one-join.js - :language: javascript - :copyable: true - :start-after: start-colls - :end-before: end-colls - :dedent: - -Delete any existing data and insert sample data into -the ``orders`` collection as shown in the following code: - -.. literalinclude:: /includes/aggregation/one-to-one-join.js - :language: javascript - :copyable: true - :start-after: start-insert-orders - :end-before: end-insert-orders - :dedent: - -Delete any existing data and insert sample data into -the ``products`` collection as shown in the following code: - -.. literalinclude:: /includes/aggregation/one-to-one-join.js - :language: javascript - :copyable: true - :start-after: start-insert-products - :end-before: end-insert-products - :dedent: - -Tutorial --------- - -.. procedure:: - :style: connected - - .. step:: Add a match stage for orders in 2020 - - Add a :manual:`$match - ` stage that matches - orders placed in 2020: - - .. literalinclude:: /includes/aggregation/one-to-one-join.js - :language: javascript - :copyable: true - :start-after: start-match - :end-before: end-match - :dedent: - - .. step:: Add a lookup stage to link the collections - - Next, add a :manual:`$lookup - ` stage. The - ``$lookup`` stage joins the ``product_id`` field in the ``orders`` - collection to the ``id`` field in the ``products`` collection: - - .. literalinclude:: /includes/aggregation/one-to-one-join.js - :language: javascript - :copyable: true - :start-after: start-lookup - :end-before: end-lookup - :dedent: - - .. step:: Add set stages to create new document fields - - Next, add two :manual:`$set ` - stages to the pipeline. - - The first ``$set`` stage sets the ``product_mapping`` field - to the first element in the ``product_mapping`` object - created in the previous ``$lookup`` stage. - - The second ``$set`` stage creates two new fields, ``product_name`` - and ``product_category``, from the values in the - ``product_mapping`` object field: - - .. literalinclude:: /includes/aggregation/one-to-one-join.js - :language: javascript - :copyable: true - :start-after: start-set - :end-before: end-set - :dedent: - - .. tip:: - - Because this is a one-to-one join, the ``$lookup`` stage - adds only one array element to the input document. The pipeline - uses the :manual:`$first ` - operator to retrieve the data from this element. - - .. step:: Add an unset stage to remove unneeded fields - - Finally, add an :manual:`$unset - ` stage. The - ``$unset`` stage removes unnecessary fields from the document: - - .. literalinclude:: /includes/aggregation/one-to-one-join.js - :language: javascript - :copyable: true - :start-after: start-unset - :end-before: end-unset - :dedent: - - .. step:: Run the aggregation pipeline - - Add the following code to the end of your application to perform - the aggregation on the ``orders`` collection: - - .. literalinclude:: /includes/aggregation/one-to-one-join.js - :language: javascript - :copyable: true - :start-after: start-run-agg - :end-before: end-run-agg - :dedent: - - Finally, run the following command in your shell to start your - application: - - .. code-block:: bash - - node agg_tutorial.js - - .. step:: Interpret results - - The aggregated result contains three documents. The documents - represent customer orders that occurred in 2020, with the - ``product_name`` and ``product_category`` of the ordered product: - - .. code-block:: javascript - :copyable: false - - { - customer_id: 'elise_smith@myemail.com', - orderdate: 2020-05-30T08:35:52.000Z, - value: 431.43, - product_name: 'Asus Laptop', - product_category: 'ELECTRONICS' - } - { - customer_id: 'oranieri@warmmail.com', - orderdate: 2020-01-01T08:25:37.000Z, - value: 63.13, - product_name: 'Morphy Richardds Food Mixer', - product_category: 'KITCHENWARE' - } - { - customer_id: 'jjones@tepidmail.com', - orderdate: 2020-12-26T08:55:46.000Z, - value: 429.65, - product_name: 'Asus Laptop', - product_category: 'ELECTRONICS' - } - - The result consists of documents that contain fields from - documents in the ``orders`` collection and the ``products`` - collection, joined by matching the ``product_id`` field present in - each original document. - -To view the complete code for this tutorial, see the `Completed One-to-one Join App -`__ -on GitHub. diff --git a/source/aggregation/unpack-arrays.txt b/source/aggregation/unpack-arrays.txt deleted file mode 100644 index 392183452..000000000 --- a/source/aggregation/unpack-arrays.txt +++ /dev/null @@ -1,210 +0,0 @@ -.. _node-aggregation-arrays: - -======================= -Unpack Arrays and Group -======================= - -.. contents:: On this page - :local: - :backlinks: none - :depth: 2 - :class: singlecol - -.. facet:: - :name: genre - :values: tutorial - -.. meta:: - :keywords: code example, node.js, analyze, array - :description: Learn to use the MongoDB Node.js Driver to create an aggregation pipeline that unpacks arrays, filters, groups, and computes fields in MongoDB. - -Introduction ------------- - -In this tutorial, you can learn how to use the {+driver-short+} to -construct an aggregation pipeline, perform the -aggregation on a collection, and print the results by completing and -running a sample app. This aggregation performs the following operations: - -- Unwinds an array field into separate documents -- Matches a subset of documents by a field value -- Groups documents by common field values -- Adds computed fields to each result document - -Aggregation Task Summary -~~~~~~~~~~~~~~~~~~~~~~~~ - -This tutorial demonstrates how to create insights from customer order -data. The results show the list of products ordered that cost more than -$15, and each document contains the number of units sold and the total -sale value for each product. - -This example uses one collection, ``orders``, which contains documents -describing product orders. Since each order contains multiple products, -the first step of the aggregation is unpacking the ``products`` array -into individual product order documents. - -Before You Get Started ----------------------- - -Before you start this tutorial, complete the -:ref:`node-agg-tutorial-template-app` instructions to set up a working -Node.js application. - -After you set up the app, access the ``orders`` collection by adding the -following code to the application: - -.. literalinclude:: /includes/aggregation/unpack-arrays.js - :language: javascript - :copyable: true - :start-after: start-coll - :end-before: end-coll - :dedent: - -Delete any existing data and insert sample data into -the ``orders`` collection as shown in the following code: - -.. literalinclude:: /includes/aggregation/unpack-arrays.js - :language: javascript - :copyable: true - :start-after: start-insert-orders - :end-before: end-insert-orders - :dedent: - -Tutorial --------- - -.. procedure:: - :style: connected - - .. step:: Add an unwind stage to unpack the array of product orders - - First, add an :manual:`$unwind - ` stage to separate the - entries in the ``products`` array into individual documents: - - .. literalinclude:: /includes/aggregation/unpack-arrays.js - :language: javascript - :copyable: true - :start-after: start-unwind - :end-before: end-unwind - :dedent: - - .. step:: Add a match stage for products that cost more than $15 - - Next, add a :manual:`$match - ` stage that matches - products with a ``products.price`` value greater than ``15``: - - .. literalinclude:: /includes/aggregation/unpack-arrays.js - :language: javascript - :copyable: true - :start-after: start-match - :end-before: end-match - :dedent: - - .. step:: Add a group stage to group by product type - - Add a :manual:`$group - ` stage to group - orders by the value of the ``prod_id`` field. In this - stage, add aggregation operations that create the - following fields in the result documents: - - - ``product``: the product name - - ``total_value``: the total value of all the sales of the product - - ``quantity``: the number of orders for the product - - .. literalinclude:: /includes/aggregation/unpack-arrays.js - :language: javascript - :copyable: true - :start-after: start-group - :end-before: end-group - :dedent: - - .. step:: Add a set stage to display the product ID - - Add a :manual:`$set - ` stage to recreate the - ``product_id`` field from the values in the ``_id`` field - that were set during the ``$group`` stage: - - .. literalinclude:: /includes/aggregation/unpack-arrays.js - :language: javascript - :copyable: true - :start-after: start-set - :end-before: end-set - :dedent: - - .. step:: Add an unset stage to remove unneeded fields - - Finally, add an :manual:`$unset - ` stage. The - ``$unset`` stage removes the ``_id`` field from the result - documents: - - .. literalinclude:: /includes/aggregation/unpack-arrays.js - :language: javascript - :copyable: true - :start-after: start-unset - :end-before: end-unset - :dedent: - - .. step:: Run the aggregation pipeline - - Add the following code to the end of your application to perform - the aggregation on the ``orders`` collection: - - .. literalinclude:: /includes/aggregation/unpack-arrays.js - :language: javascript - :copyable: true - :start-after: start-run-agg - :end-before: end-run-agg - :dedent: - - Finally, run the following command in your shell to start your - application: - - .. code-block:: bash - - node agg_tutorial.js - - .. step:: Interpret results - - The aggregation returns the following summary of customers' orders - from 2020: - - .. code-block:: javascript - :copyable: false - - { - product: 'Asus Laptop', - total_value: 860, - quantity: 2, - product_id: 'abc12345' - } - { - product: 'Morphy Richards Food Mixer', - total_value: 431, - quantity: 1, - product_id: 'pqr88223' - } - { - product: 'Russell Hobbs Chrome Kettle', - total_value: 16, - quantity: 1, - product_id: 'xyz11228' - } - { - product: 'Karcher Hose Set', - total_value: 66, - quantity: 3, - product_id: 'def45678' - } - - The result documents contain details about the total value and - quantity of orders for products that cost more than $15. - -To view the complete code for this tutorial, see the `Completed Unpack Arrays App -`__ -on GitHub. diff --git a/source/connect/connection-options.txt b/source/connect/connection-options.txt index fbffaa407..2e060f1c2 100644 --- a/source/connect/connection-options.txt +++ b/source/connect/connection-options.txt @@ -104,8 +104,7 @@ string, see :manual:`Connection Strings ` in the * - **enableUtf8Validation** - boolean - ``true`` - - - Specifying ``true`` enables UTF-8 validation for the + - Specifying ``true`` enables UTF-8 validation for the connection. MongoDB throws an error when it attempts to serialize string data that contains invalid UTF-8 characters to BSON. This applies to both document keys and @@ -119,9 +118,8 @@ string, see :manual:`Connection Strings ` in the can result in loss of data. Disabling UTF-8 validation is a temporary workaround to query or export data only. - You can also set UTF-8 validation in your :ref:`Node.js code - `. To learn more about UTF-8 characters, - see `UTF-8 `__ on Wikipedia. + To learn more about UTF-8 characters, see :wikipedia:`UTF-8 + ` on Wikipedia. * - **heartbeatFrequencyMS** - integer greater than or equal to 500 diff --git a/source/monitoring-and-logging/change-streams.txt b/source/monitoring-and-logging/change-streams.txt index baeb054da..a99f4b27a 100644 --- a/source/monitoring-and-logging/change-streams.txt +++ b/source/monitoring-and-logging/change-streams.txt @@ -1,5 +1,4 @@ .. _node-change-streams: -.. _node-usage-watch: ================================ Monitor Data with Change Streams @@ -222,4 +221,5 @@ methods mentioned on this page: - `ChangeStream class API documentation <{+api+}/classes/ChangeStream.html>`__ - `Collection.watch() <{+api+}/classes/Collection.html#watch>`__, - `Db.watch() <{+api+}/classes/Db.html#watch>`__, -- `MongoClient.watch() API documentation <{+api+}/classes/MongoClient.html#watch>`__ \ No newline at end of file +- `MongoClient.watch() API documentation + <{+api+}/classes/MongoClient.html#watch>`__ From ea03454e7c329123107ba809608a676617c2e341 Mon Sep 17 00:00:00 2001 From: rustagir Date: Wed, 18 Jun 2025 14:39:49 -0400 Subject: [PATCH 2/4] shift redirects --- config/redirects | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/config/redirects b/config/redirects index 3863be263..d310edd3e 100644 --- a/config/redirects +++ b/config/redirects @@ -67,19 +67,6 @@ raw: ${prefix}/stable -> ${base}/current/ [v6.5-master]: ${prefix}/${version}/usage-examples/changeStream -> ${base}/monitoring-and-logging/change-streams/ [v6.5-master]: ${prefix}/${version}/fundamentals/aggregation/ -> ${base}/${version}/aggregation/ -## Aggregation Tutorials Redirects - -[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/filtered-subset/ -> ${server}/tutorial/aggregation-examples/filtered-subset/ -[*-master]: ${prefix}/${version}/aggregation/filtered-subset/ -> ${server}/tutorial/aggregation-examples/filtered-subset/ -[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/group-total/ -> ${server}/tutorial/aggregation-examples/group-and-total/ -[*-master]: ${prefix}/${version}/aggregation/group-total/ -> ${server}/tutorial/aggregation-examples/group-and-total/ -[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/multi-field-join/ -> ${server}/tutorial/aggregation-examples/multi-field-join/ -[*-master]: ${prefix}/${version}/aggregation/multi-field-join/ -> ${server}/tutorial/aggregation-examples/multi-field-join/ -[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/one-to-one-join/ ->${server}/tutorial/aggregation-examples/one-to-one-join/ -[*-master]: ${prefix}/${version}/aggregation/one-to-one-join/ -> ${server}/tutorial/aggregation-examples/one-to-one-join/ -[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/unpack-arrays/ -> ${server}/tutorial/aggregation-examples/unpack-arrays/ -[*-master]: ${prefix}/${version}/aggregation/unpack-arrays/ -> ${server}/tutorial/aggregation-examples/unpack-arrays/ - [v6.5-master]: ${prefix}/${version}/fundamentals/authentication -> ${base}/${version}/security/authentication/ [v6.5-v6.15]: ${prefix}/${version}/fundamentals/authentication/mechanisms/ -> ${base}/${version}/security/authentication/mechanisms/ @@ -125,3 +112,16 @@ raw: ${prefix}/stable -> ${base}/current/ [v6.16-master]: ${prefix}/${version}/usage-examples/transactions/ -> ${base}/${version}/crud/transactions/ [v6.16-master]: ${prefix}/${version}/usage-examples/transaction-conv/ -> ${base}/${version}/crud/transactions/transaction-conv/ [v6.16-master]: ${prefix}/${version}/usage-examples/transaction-core/ -> ${base}/${version}/crud/transactions/transaction-core/ + +## Aggregation Tutorials Redirects + +[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/filtered-subset/ -> ${server}/tutorial/aggregation-examples/filtered-subset/ +[*-master]: ${prefix}/${version}/aggregation/filtered-subset/ -> ${server}/tutorial/aggregation-examples/filtered-subset/ +[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/group-total/ -> ${server}/tutorial/aggregation-examples/group-and-total/ +[*-master]: ${prefix}/${version}/aggregation/group-total/ -> ${server}/tutorial/aggregation-examples/group-and-total/ +[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/multi-field-join/ -> ${server}/tutorial/aggregation-examples/multi-field-join/ +[*-master]: ${prefix}/${version}/aggregation/multi-field-join/ -> ${server}/tutorial/aggregation-examples/multi-field-join/ +[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/one-to-one-join/ -> ${server}/tutorial/aggregation-examples/one-to-one-join/ +[*-master]: ${prefix}/${version}/aggregation/one-to-one-join/ -> ${server}/tutorial/aggregation-examples/one-to-one-join/ +[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/unpack-arrays/ -> ${server}/tutorial/aggregation-examples/unpack-arrays/ +[*-master]: ${prefix}/${version}/aggregation/unpack-arrays/ -> ${server}/tutorial/aggregation-examples/unpack-arrays/ From 26eb633fa7c528f9980d53675c92ed0f37934147 Mon Sep 17 00:00:00 2001 From: rustagir Date: Wed, 18 Jun 2025 14:40:56 -0400 Subject: [PATCH 3/4] shift redirects --- config/redirects | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/config/redirects b/config/redirects index d310edd3e..07d37f16d 100644 --- a/config/redirects +++ b/config/redirects @@ -115,13 +115,13 @@ raw: ${prefix}/stable -> ${base}/current/ ## Aggregation Tutorials Redirects -[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/filtered-subset/ -> ${server}/tutorial/aggregation-examples/filtered-subset/ -[*-master]: ${prefix}/${version}/aggregation/filtered-subset/ -> ${server}/tutorial/aggregation-examples/filtered-subset/ -[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/group-total/ -> ${server}/tutorial/aggregation-examples/group-and-total/ -[*-master]: ${prefix}/${version}/aggregation/group-total/ -> ${server}/tutorial/aggregation-examples/group-and-total/ -[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/multi-field-join/ -> ${server}/tutorial/aggregation-examples/multi-field-join/ -[*-master]: ${prefix}/${version}/aggregation/multi-field-join/ -> ${server}/tutorial/aggregation-examples/multi-field-join/ -[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/one-to-one-join/ -> ${server}/tutorial/aggregation-examples/one-to-one-join/ -[*-master]: ${prefix}/${version}/aggregation/one-to-one-join/ -> ${server}/tutorial/aggregation-examples/one-to-one-join/ -[*-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/unpack-arrays/ -> ${server}/tutorial/aggregation-examples/unpack-arrays/ -[*-master]: ${prefix}/${version}/aggregation/unpack-arrays/ -> ${server}/tutorial/aggregation-examples/unpack-arrays/ +[v6.5-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/filtered-subset/ -> ${server}/tutorial/aggregation-examples/filtered-subset/ +[v6.5-master]: ${prefix}/${version}/aggregation/filtered-subset/ -> ${server}/tutorial/aggregation-examples/filtered-subset/ +[v6.5-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/group-total/ -> ${server}/tutorial/aggregation-examples/group-and-total/ +[v6.5-master]: ${prefix}/${version}/aggregation/group-total/ -> ${server}/tutorial/aggregation-examples/group-and-total/ +[v6.5-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/multi-field-join/ -> ${server}/tutorial/aggregation-examples/multi-field-join/ +[v6.5-master]: ${prefix}/${version}/aggregation/multi-field-join/ -> ${server}/tutorial/aggregation-examples/multi-field-join/ +[v6.5-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/one-to-one-join/ -> ${server}/tutorial/aggregation-examples/one-to-one-join/ +[v6.5-master]: ${prefix}/${version}/aggregation/one-to-one-join/ -> ${server}/tutorial/aggregation-examples/one-to-one-join/ +[v6.5-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/unpack-arrays/ -> ${server}/tutorial/aggregation-examples/unpack-arrays/ +[v6.5-master]: ${prefix}/${version}/aggregation/unpack-arrays/ -> ${server}/tutorial/aggregation-examples/unpack-arrays/ From 5a770f47bccb50fe0c44b96e289a82b68d9373dc Mon Sep 17 00:00:00 2001 From: rustagir Date: Wed, 18 Jun 2025 14:42:42 -0400 Subject: [PATCH 4/4] shift redirects --- config/redirects | 1 + 1 file changed, 1 insertion(+) diff --git a/config/redirects b/config/redirects index 07d37f16d..08f8e2def 100644 --- a/config/redirects +++ b/config/redirects @@ -115,6 +115,7 @@ raw: ${prefix}/stable -> ${base}/current/ ## Aggregation Tutorials Redirects +[v6.5-master]: ${prefix}/${version}/aggregation-tutorials/ -> ${server}/tutorial/aggregation-complete-examples/ [v6.5-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/filtered-subset/ -> ${server}/tutorial/aggregation-examples/filtered-subset/ [v6.5-master]: ${prefix}/${version}/aggregation/filtered-subset/ -> ${server}/tutorial/aggregation-examples/filtered-subset/ [v6.5-master]: ${prefix}/${version}/aggregation/aggregation-tutorials/group-total/ -> ${server}/tutorial/aggregation-examples/group-and-total/