diff --git a/source/aggregation.txt b/source/aggregation.txt
index 764dc9d092b..2ce36218a3a 100644
--- a/source/aggregation.txt
+++ b/source/aggregation.txt
@@ -41,7 +41,7 @@ transforms the documents into an aggregated result. For example:
-In the example,
+In the example:
.. code-block:: javascript
@@ -82,28 +82,6 @@ internal optimization phase. See
:ref:`aggregation-pipeline-operators-and-performance` and
:doc:`/core/aggregation-pipeline-optimization` for details.
-.. _aggregation-map-reduce:
-
-Map-Reduce
-----------
-
-.. tip::
-
- :doc:`Aggregation pipeline `
- provides better performance and a more coherent interface than
- map-reduce.
-
- For examples of aggregation alternatives to map-reduce operations,
- see :doc:`/tutorial/map-reduce-examples`. See also
- :doc:`/reference/map-reduce-to-aggregation-pipeline`.
-
-MongoDB also provides :doc:`map-reduce ` operations
-to perform aggregation. Map-reduce uses custom JavaScript functions to
-perform the map and reduce operations, as well as the optional
-*finalize* operation.
-
-.. include:: /images/map-reduce.rst
-
.. _single-purpose-agg-operations:
Single Purpose Aggregation Operations
@@ -114,11 +92,18 @@ MongoDB also provides :method:`db.collection.estimatedDocumentCount()`,
All of these operations aggregate documents from a single collection.
While these operations provide simple access to common aggregation
-processes, they lack the flexibility and capabilities of the
-aggregation pipeline and map-reduce.
+processes, they lack the flexibility and capabilities of an aggregation
+pipeline.
.. include:: /images/distinct.rst
+.. _aggregation-map-reduce:
+
+Map-Reduce
+----------
+
+.. include:: /includes/fact-use-aggregation-not-map-reduce.rst
+
Additional Features and Behaviors
---------------------------------
diff --git a/source/core/aggregation-pipeline.txt b/source/core/aggregation-pipeline.txt
index e01c41fc7ac..db872563f96 100644
--- a/source/core/aggregation-pipeline.txt
+++ b/source/core/aggregation-pipeline.txt
@@ -29,7 +29,7 @@ results. For example:
-In the example,
+In the example:
.. code-block:: javascript
@@ -53,8 +53,8 @@ Pipeline
The MongoDB aggregation pipeline consists of :ref:`stages
`. Each stage transforms the
-documents as they pass through the pipeline. Pipeline stages do not
-need to produce one output document for every input document; e.g.,
+documents as they pass through the pipeline. Pipeline stages do not need
+to produce one output document for every input document. For example,
some stages may generate new documents or filter out documents.
Pipeline stages can appear multiple times in the pipeline with the
@@ -98,11 +98,11 @@ by the aggregation process with one exception: :ref:`accumulator
` expressions.
The accumulators, used in the :pipeline:`$group` stage, maintain their
-state (e.g. totals, maximums, minimums, and related data) as documents
-progress through the pipeline. Some accumulators are available in the
-:pipeline:`$project` stage; however, when used in the
-:pipeline:`$project` stage, the accumulators do not maintain their
-state across documents.
+state (for example, totals, maximums, minimums, and related data) as
+documents progress through the pipeline. Some accumulators are available
+in the :pipeline:`$project` stage; however, when used in the
+:pipeline:`$project` stage, the accumulators do not maintain their state
+across documents.
Starting in version 4.4, MongoDB provides the :group:`$accumulator` and
:expression:`$function` aggregation operators. These operators provide
@@ -194,41 +194,29 @@ pipeline.
Considerations
--------------
-Sharded Collections
-~~~~~~~~~~~~~~~~~~~~
+Aggregation Pipeline Limitations
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The aggregation pipeline supports operations on sharded collections.
-See :ref:`aggregation-pipeline-sharded-collection`.
-
-Aggregation Pipeline vs Map-Reduce
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+An aggregation pipeline has some limitations on the value types and
+the result size. See :doc:`/core/aggregation-pipeline-limits`.
-The aggregation pipeline provides better performance and a more coherent
-interface than :doc:`map-reduce `.
+Aggregation Pipeline Optimization
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Various map-reduce operations can be rewritten using :doc:`aggregation
-pipeline operators `, such as
-:pipeline:`$group`, :pipeline:`$merge`, etc. For map-reduce operations
-that require custom functionality, MongoDB provides the
-:group:`$accumulator` and :expression:`$function` aggregation operators
-starting in version 4.4. These operators provide users with the ability
-to define custom aggregation expressions in JavaScript.
+An aggregation pipeline has an internal optimization phase that provides
+improved performance for certain sequences of operators. See
+:doc:`/core/aggregation-pipeline-optimization`.
-See :doc:`/tutorial/map-reduce-examples` for details.
-
-Limitations
-~~~~~~~~~~~
+Aggregation on Sharded Collections
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Aggregation pipeline have some limitations on value types and result
-size. See :doc:`/core/aggregation-pipeline-limits` for details on
-limits and restrictions on the aggregation pipeline.
+An aggregation pipeline supports operations on sharded collections.
+See :ref:`aggregation-pipeline-sharded-collection`.
-Pipeline Optimization
-~~~~~~~~~~~~~~~~~~~~~
+Aggregation Pipeline as an Alternative to Map-Reduce
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The aggregation pipeline has an internal optimization phase that
-provides improved performance for certain sequences of operators. For
-details, see :doc:`/core/aggregation-pipeline-optimization`.
+.. include:: /includes/fact-use-aggregation-not-map-reduce.rst
.. toctree::
:titlesonly:
diff --git a/source/core/map-reduce-concurrency.txt b/source/core/map-reduce-concurrency.txt
index 63a5dcadf52..619e2791fa7 100644
--- a/source/core/map-reduce-concurrency.txt
+++ b/source/core/map-reduce-concurrency.txt
@@ -10,6 +10,11 @@ Map-Reduce Concurrency
:depth: 1
:class: singlecol
+.. admonition:: Aggregation Pipeline as an Alternative to Map-Reduce
+ :class: note
+
+ .. include:: /includes/fact-use-aggregation-not-map-reduce.rst
+
The map-reduce operation is composed of many tasks, including reads
from the input collection, executions of the ``map`` function,
executions of the ``reduce`` function, writes to a temporary collection
diff --git a/source/core/map-reduce-sharded-collections.txt b/source/core/map-reduce-sharded-collections.txt
index 656f3dede6c..4bf5c0027e5 100644
--- a/source/core/map-reduce-sharded-collections.txt
+++ b/source/core/map-reduce-sharded-collections.txt
@@ -10,6 +10,11 @@ Map-Reduce and Sharded Collections
:depth: 1
:class: singlecol
+.. admonition:: Aggregation Pipeline as an Alternative to Map-Reduce
+ :class: note
+
+ .. include:: /includes/fact-use-aggregation-not-map-reduce.rst
+
Map-reduce supports operations on sharded collections, both as an input
and as an output. This section describes the behaviors of
:dbcommand:`mapReduce` specific to sharded collections.
diff --git a/source/core/map-reduce.txt b/source/core/map-reduce.txt
index 851251088c3..ab4b165b563 100644
--- a/source/core/map-reduce.txt
+++ b/source/core/map-reduce.txt
@@ -10,19 +10,10 @@ Map-Reduce
:depth: 1
:class: singlecol
-.. admonition:: Aggregation Pipeline as Alternative
+.. admonition:: Aggregation Pipeline as Alternative to Map-Reduce
:class: note
- :doc:`Aggregation pipeline `
- provides better performance and a more coherent interface than
- map-reduce, and various map-reduce operations can be rewritten
- using :doc:`aggregation pipeline operators
- `, such as :pipeline:`$group`,
- :pipeline:`$merge`, :group:`$accumulator`, etc.
-
- For examples of aggregation alternatives to map-reduce operations,
- see :doc:`/tutorial/map-reduce-examples`. See also
- :doc:`/reference/map-reduce-to-aggregation-pipeline`.
+ .. include:: /includes/fact-use-aggregation-not-map-reduce.rst
Map-reduce is a data processing paradigm for condensing large volumes
of data into useful *aggregated* results. To perform map-reduce
diff --git a/source/includes/examples-map-reduce.rst b/source/includes/examples-map-reduce.rst
index 1d0f9654b38..42e8a72d96c 100644
--- a/source/includes/examples-map-reduce.rst
+++ b/source/includes/examples-map-reduce.rst
@@ -4,25 +4,10 @@ Map-Reduce Examples
.. map-reduce-document-examples-begin
.. map-reduce-document-prototype-begin
-.. admonition:: Aggregation Pipeline as Alternative
- :class: note
-
- :doc:`Aggregation pipeline ` provides
- better performance and a simpler interface than map-reduce, and
- map-reduce expressions can be rewritten using :doc:`aggregation
- pipeline operators ` such as
- :pipeline:`$group`, :pipeline:`$merge`, and others.
-
- For map-reduce expressions that require custom functionality, MongoDB
- provides the :group:`$accumulator` and :expression:`$function`
- aggregation operators starting in version 4.4. These operators
- provide the ability to define custom aggregation expressions in
- JavaScript.
-
- The examples in this section include aggregation pipeline
- alternatives without custom aggregation expressions. For alternatives
- that use custom expressions, see :ref:`Map-Reduce to Aggregation
- Pipeline Translation Examples `.
+The examples in this section include aggregation pipeline alternatives
+without custom aggregation expressions. For alternatives that use custom
+expressions, see :ref:`Map-Reduce to Aggregation Pipeline Translation
+Examples `.
Create a sample collection ``orders`` with these documents:
diff --git a/source/includes/fact-use-aggregation-not-map-reduce.rst b/source/includes/fact-use-aggregation-not-map-reduce.rst
new file mode 100644
index 00000000000..735157172ff
--- /dev/null
+++ b/source/includes/fact-use-aggregation-not-map-reduce.rst
@@ -0,0 +1,16 @@
+An :doc:`aggregation pipeline ` provides
+better performance and usability than a :doc:`map-reduce
+` operation.
+
+Map-reduce operations can be rewritten using :doc:`aggregation pipeline
+operators `, such as
+:pipeline:`$group`, :pipeline:`$merge`, and others.
+
+For map-reduce operations that require custom functionality, MongoDB
+provides the :group:`$accumulator` and :expression:`$function`
+aggregation operators starting in version 4.4. Use these operators to
+define custom aggregation expressions in JavaScript.
+
+For examples of aggregation pipeline alternatives to map-reduce
+operations, see :doc:`/reference/map-reduce-to-aggregation-pipeline` and
+:doc:`/tutorial/map-reduce-examples`.
diff --git a/source/reference/aggregation-commands-comparison.txt b/source/reference/aggregation-commands-comparison.txt
index e7f6f98dec6..f291b3e1ebd 100644
--- a/source/reference/aggregation-commands-comparison.txt
+++ b/source/reference/aggregation-commands-comparison.txt
@@ -10,18 +10,10 @@ Aggregation Commands Comparison
:depth: 1
:class: singlecol
-.. tip::
+.. admonition:: Aggregation Pipeline as Alternative to Map-Reduce
+ :class: note
- Starting in version 4.4, MongoDB adds the :group:`$accumulator` and
- :expression:`$function` aggregation operators. Using
- :group:`$accumulator` and :expression:`$function` ,
- :dbcommand:`mapReduce` expressions can be re-written using the
- aggregation operators.
-
- Even before version 4.4, some map-reduce expressions could also be
- rewritten using :doc:`other aggregation pipeline operators
- `, such as :pipeline:`$group`,
- :pipeline:`$merge`, etc.
+ .. include:: /includes/fact-use-aggregation-not-map-reduce.rst
Aggregation Commands Comparison Table
-------------------------------------
@@ -47,7 +39,7 @@ MongoDB aggregation commands.
Uses a "pipeline" approach where objects are transformed as they
pass through a series of pipeline operators such as
- :pipeline:`$group`, :pipeline:`$match`, and :pipeline:`$sort`.
+ :pipeline:`$group`, :pipeline:`$match`, and :pipeline:`$sort`.
See :doc:`/reference/operator/aggregation` for more information
on the pipeline operators.
diff --git a/source/reference/command/mapReduce.txt b/source/reference/command/mapReduce.txt
index 646528c591c..f5fec23893e 100644
--- a/source/reference/command/mapReduce.txt
+++ b/source/reference/command/mapReduce.txt
@@ -10,10 +10,10 @@ mapReduce
:depth: 1
:class: singlecol
-.. admonition:: Deprecated
- :class: warning
+.. admonition:: Aggregation Pipeline as Alternative to Map-Reduce
+ :class: note
- .. include:: /includes/5.0-mapReduce-deprecated.rst
+ .. include:: /includes/fact-use-aggregation-not-map-reduce.rst
Definition
----------
@@ -22,26 +22,6 @@ Definition
The :dbcommand:`mapReduce` command allows you to run
:term:`map-reduce` aggregation operations over a collection.
-
- .. admonition:: Aggregation Pipeline as Alternative
- :class: note
-
- :doc:`Aggregation pipeline `
- provides better performance and a simpler interface than
- map-reduce, and map-reduce expressions can be
- rewritten using :doc:`aggregation pipeline operators
- `, such as :pipeline:`$group`,
- :pipeline:`$merge`, and so on.
-
- For map-reduce expressions that require custom functionality,
- MongoDB provides the :group:`$accumulator` and
- :expression:`$function` aggregation operators starting in version
- 4.4. These operators provide users with the ability to define custom
- aggregation expressions in JavaScript.
-
- For examples of aggregation alternatives to map-reduce operations,
- see :doc:`/tutorial/map-reduce-examples`. See also
- :doc:`/reference/map-reduce-to-aggregation-pipeline`.
Syntax
------
diff --git a/source/reference/map-reduce-to-aggregation-pipeline.txt b/source/reference/map-reduce-to-aggregation-pipeline.txt
index e014e941bb7..c5f72e37cfd 100644
--- a/source/reference/map-reduce-to-aggregation-pipeline.txt
+++ b/source/reference/map-reduce-to-aggregation-pipeline.txt
@@ -4,20 +4,21 @@ Map-Reduce to Aggregation Pipeline
.. default-domain:: mongodb
-Starting in version 4.4, MongoDB adds the :group:`$accumulator` and
-:expression:`$function` aggregation operators. These operators provide
-users the ability to define custom aggregation expressions. Using these
-operations, the map-reduce expressions can be approximately re-written
-as in the following table.
+An :doc:`aggregation pipeline ` provides
+better performance and usability than a :doc:`map-reduce
+` operation.
-.. note::
+Map-reduce operations can be rewritten using :doc:`aggregation pipeline
+operators `, such as
+:pipeline:`$group`, :pipeline:`$merge`, and others.
- Various map-reduce expressions can be rewritten using
- :doc:`aggregation pipeline operators
- `, such as :pipeline:`$group`,
- :pipeline:`$merge`, etc., without requiring custom functions.
+For map-reduce operations that require custom functionality, MongoDB
+provides the :group:`$accumulator` and :expression:`$function`
+aggregation operators starting in version 4.4. Use these operators to
+define custom aggregation expressions in JavaScript.
- For examples, see :doc:`/tutorial/map-reduce-examples`.
+Map-reduce expressions can be re-written as shown in the following
+sections.
Map-Reduce to Aggregation Pipeline Translation Table
----------------------------------------------------
@@ -250,9 +251,9 @@ Examples
Various map-reduce expressions can be rewritten using :doc:`aggregation
pipeline operators `, such as
-:pipeline:`$group`, :pipeline:`$merge`, etc., without requiring custom
-functions. However, for illustrative purposes, the following examples
-provide both alternatives.
+:pipeline:`$group`, :pipeline:`$merge`, and others, without requiring
+custom functions. However, for illustrative purposes, the following
+examples provide both alternatives.
.. _mr-to-agg-examples1:
diff --git a/source/reference/method/db.collection.mapReduce.txt b/source/reference/method/db.collection.mapReduce.txt
index dae52695207..a2e1f38a34b 100644
--- a/source/reference/method/db.collection.mapReduce.txt
+++ b/source/reference/method/db.collection.mapReduce.txt
@@ -10,39 +10,18 @@ db.collection.mapReduce()
:depth: 1
:class: singlecol
-.. admonition:: Deprecated
- :class: warning
+.. admonition:: Aggregation Pipeline as Alternative to Map-Reduce
+ :class: note
- .. include:: /includes/5.0-mapReduce-deprecated.rst
+ .. include:: /includes/fact-use-aggregation-not-map-reduce.rst
.. method:: db.collection.mapReduce(map,reduce, { })
-
.. include:: /includes/fact-mongo-shell-method.rst
The :method:`db.collection.mapReduce()` method provides a wrapper
around the :dbcommand:`mapReduce` command.
- .. admonition:: Aggregation Pipeline as Alternative
- :class: note
-
- :doc:`Aggregation pipeline `
- provides better performance and a simpler interface than
- map-reduce, and map-reduce expressions can be
- rewritten using :doc:`aggregation pipeline operators
- `, such as :pipeline:`$group`,
- :pipeline:`$merge`, and so on.
-
- For map-reduce expressions that require custom functionality,
- MongoDB provides the :group:`$accumulator` and
- :expression:`$function` aggregation operators starting in version
- 4.4. These operators provide users with the ability to define custom
- aggregation expressions in JavaScript.
-
- For examples of aggregation alternatives to map-reduce operations,
- see :doc:`/tutorial/map-reduce-examples`. See also
- :doc:`/reference/map-reduce-to-aggregation-pipeline`.
-
.. note::
.. include:: /includes/extracts/views-unsupported-mapReduce.rst
diff --git a/source/release-notes/5.0-compatibility.txt b/source/release-notes/5.0-compatibility.txt
index 8e702b859e3..024d339f4a2 100644
--- a/source/release-notes/5.0-compatibility.txt
+++ b/source/release-notes/5.0-compatibility.txt
@@ -68,11 +68,5 @@ General Changes
Deprecations
~~~~~~~~~~~~
-Map Reduce
-``````````
-
-.. include:: /includes/5.0-mapReduce-deprecated.rst
-
-
5.0 Feature Compatibility
-------------------------
diff --git a/source/release-notes/5.0.txt b/source/release-notes/5.0.txt
index 62a8ea73945..1d9ceafeb54 100644
--- a/source/release-notes/5.0.txt
+++ b/source/release-notes/5.0.txt
@@ -15,11 +15,6 @@ Release Notes for MongoDB 5.0
Aggregation
-----------
-Map Reduce Deprecated
-~~~~~~~~~~~~~~~~~~~~~
-
-.. include:: /includes/5.0-mapReduce-deprecated.rst
-
New Aggregation Operators
~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/source/tutorial/map-reduce-examples.txt b/source/tutorial/map-reduce-examples.txt
index 125b96624f0..d68844c7c9c 100644
--- a/source/tutorial/map-reduce-examples.txt
+++ b/source/tutorial/map-reduce-examples.txt
@@ -10,9 +10,25 @@ Map-Reduce Examples
:depth: 1
:class: singlecol
+.. admonition:: Aggregation Pipeline as Alternative to Map-Reduce
+ :class: note
+
+ An :doc:`aggregation pipeline ` provides
+ better performance and usability than a :doc:`map-reduce
+ ` operation.
+
+ Map-reduce operations can be rewritten using :doc:`aggregation
+ pipeline operators `, such as
+ :pipeline:`$group`, :pipeline:`$merge`, and others.
+
+ For map-reduce operations that require custom functionality, MongoDB
+ provides the :group:`$accumulator` and :expression:`$function`
+ aggregation operators starting in version 4.4. Use these operators to
+ define custom aggregation expressions in JavaScript.
+
In the :binary:`~bin.mongo` shell, the :method:`db.collection.mapReduce()`
method is a wrapper around the :dbcommand:`mapReduce` command. The
-following examples use the :method:`db.collection.mapReduce()` method:
+following examples use the :method:`db.collection.mapReduce()` method.
.. include:: /includes/examples-map-reduce.rst
:start-after: map-reduce-document-prototype-begin
diff --git a/source/tutorial/perform-incremental-map-reduce.txt b/source/tutorial/perform-incremental-map-reduce.txt
index d98a5984d81..48f2d3586a7 100644
--- a/source/tutorial/perform-incremental-map-reduce.txt
+++ b/source/tutorial/perform-incremental-map-reduce.txt
@@ -10,26 +10,14 @@ Perform Incremental Map-Reduce
:depth: 1
:class: singlecol
-
-.. admonition:: Aggregation Pipeline as Alternative
+.. admonition:: Aggregation Pipeline as Alternative to Map-Reduce
:class: note
- :doc:`Aggregation pipeline `
- provides better performance and a more coherent interface than
- map-reduce.
-
- Various map-reduce operations can be rewritten using
- :doc:`aggregation pipeline operators
- `, such as :pipeline:`$group`,
- :pipeline:`$merge`, etc. For map-reduce operations that require
- custom functionality, MongoDB provides the :group:`$accumulator` and
- :expression:`$function` aggregation operators starting in version
- 4.4.
+ .. include:: /includes/fact-use-aggregation-not-map-reduce.rst
- The example below includes aggregation pipeline alternative without
- requiring custom function.
-
- For examples using the custom aggregation function, see
+ This section has an example aggregation pipeline alternative to
+ map-reduce that does not use a custom function. For an example that
+ uses a custom function, see
:doc:`/reference/map-reduce-to-aggregation-pipeline`.
To perform map-reduce operations, MongoDB provides the
@@ -45,7 +33,7 @@ To perform incremental map-reduce:
#. Run a map-reduce job over the current collection and output the
result to a separate collection.
-#. When you have more data to process, run subsequent map-reduce job
+#. When you have more data to process, run subsequent map-reduce jobs
with:
- the ``query`` parameter that specifies conditions that match
@@ -151,7 +139,7 @@ Run the first map-reduce operation as follows:
db.session_stats.find().sort( { _id: 1 } )
- The operation returns the following document:
+ The operation returns the following documents:
.. code-block:: javascript
:copyable: false
@@ -201,7 +189,7 @@ Query the ``session_stats`` collection to verify the results:
db.session_stats.find().sort( { _id: 1 } )
-The operation returns the following document:
+The operation returns the following documents:
.. code-block:: javascript
:copyable: false
@@ -214,7 +202,12 @@ The operation returns the following document:
Aggregation Alternative
-----------------------
-Prereq: Set up the collection to its original state:
+As an alternative to map-reduce, you can use an :doc:`aggregation
+pipeline ` that combines :pipeline:`$group`
+and :pipeline:`$merge` stages to achieve the same result in a more
+flexible operation.
+
+Recreate the ``usersessions`` collection:
.. code-block:: javascript
@@ -296,7 +289,7 @@ map-reduce example without defining custom functions:
db.session_stats_agg.find().sort( { _id: 1 } )
- The operation returns the following document:
+ The operation returns the following documents:
.. code-block:: javascript
:copyable: false
@@ -343,7 +336,7 @@ map-reduce example without defining custom functions:
db.session_stats_agg.find().sort( { _id: 1 } )
- The operation returns the following document:
+ The operation returns the following documents:
.. code-block:: javascript
:copyable: false
diff --git a/source/tutorial/troubleshoot-map-function.txt b/source/tutorial/troubleshoot-map-function.txt
index 4f8140af50a..c1385e4babd 100644
--- a/source/tutorial/troubleshoot-map-function.txt
+++ b/source/tutorial/troubleshoot-map-function.txt
@@ -10,6 +10,14 @@ Troubleshoot the Map Function
:depth: 1
:class: singlecol
+.. admonition:: Aggregation Pipeline as Alternative to Map-Reduce
+ :class: note
+
+ .. include:: /includes/fact-use-aggregation-not-map-reduce.rst
+
+ An :doc:`aggregation pipeline ` is also
+ easier to troubleshoot than a map-reduce operation.
+
The ``map`` function is a JavaScript function that associates or “maps”
a value with a key and emits the key and value pair during a
:doc:`map-reduce ` operation.
diff --git a/source/tutorial/troubleshoot-reduce-function.txt b/source/tutorial/troubleshoot-reduce-function.txt
index b59c70af961..b4b0bd72c8d 100644
--- a/source/tutorial/troubleshoot-reduce-function.txt
+++ b/source/tutorial/troubleshoot-reduce-function.txt
@@ -10,6 +10,14 @@ Troubleshoot the Reduce Function
:depth: 1
:class: singlecol
+.. admonition:: Aggregation Pipeline as Alternative to Map-Reduce
+ :class: note
+
+ .. include:: /includes/fact-use-aggregation-not-map-reduce.rst
+
+ An :doc:`aggregation pipeline ` is also
+ easier to troubleshoot than a map-reduce operation.
+
The ``reduce`` function is a JavaScript function that “reduces” to a
single object all the values associated with a particular key during a
:doc:`map-reduce ` operation. The ``reduce`` function
diff --git a/source/tutorial/use-database-commands.txt b/source/tutorial/use-database-commands.txt
index 2859d5f06db..10d22b89341 100644
--- a/source/tutorial/use-database-commands.txt
+++ b/source/tutorial/use-database-commands.txt
@@ -13,9 +13,9 @@ Use Database Commands
:class: singlecol
The MongoDB command interface provides access to all :term:`non CRUD
-` database operations. Fetching server stats, initializing a
-replica set, and running a map-reduce job are all accomplished with
-commands.
+` database operations. Fetching server statistics, initializing a
+replica set, and running an aggregation pipeline or map-reduce job are
+all accomplished with commands.
See :doc:`/reference/command` for list of all commands sorted by
function.
@@ -39,7 +39,7 @@ Issue Commands
The :binary:`~bin.mongo` shell provides a helper method for running
commands called :method:`db.runCommand()`. The following operation in
-:binary:`~bin.mongo` runs the above command:
+:binary:`~bin.mongo` runs the previous command:
.. code-block:: javascript
@@ -65,7 +65,7 @@ more information on operation termination.
---------------------------
You must run some commands on the :term:`admin database`. Normally,
-these operations resemble the followings:
+these operations resemble the following:
.. code-block:: javascript