Skip to content

Update index-tutorials-considerations.rst #5133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 150 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
cbe1396
Revert 5.0-specific updates
Nov 11, 2020
784e1df
adjust redirects
Nov 11, 2020
a07fb8c
DOCSP-13127 correct version mismatches between branches
andf-mongodb Nov 11, 2020
c473c26
Update redirects
andf-mongodb Nov 11, 2020
1e52d3e
DOCS-13914 update 4.0.21 changelog
andf-mongodb Nov 11, 2020
4ed0303
DOCS-13914 update 4.0.21 summary ticket description
andf-mongodb Nov 11, 2020
e794d61
DOCSP-11589 update pre-3.6 reading own writes section
andf-mongodb Nov 11, 2020
96576aa
Trivial: correct capitalization of ID
andf-mongodb Nov 12, 2020
b7ec492
Trivial: correct capitalization of ID
andf-mongodb Nov 12, 2020
04cdee0
(DOCSP-11857): SERVER-49694 fixed in 4.1.1
jeff-allen-mongo Aug 18, 2020
0fe7c84
(DOCS-13839): Rename ocspValidationRefreshPeriodSecs param
jeff-allen-mongo Aug 18, 2020
12799c8
DOCSP-11989 Slave ok no longer documented
jason-price-mongodb Nov 12, 2020
c444c3c
DOCSP-13033 properly pluralizes "tutorials"
jmd-mongo Nov 12, 2020
cbce7e9
DOCS-13955 release 3.6.21
andf-mongodb Nov 16, 2020
51e3e38
DOCS-13970 generate initial changelog 4.2.11
andf-mongodb Nov 16, 2020
cca0d0a
DOCSP-10628 substrCP example correction
jmd-mongo Nov 16, 2020
0c882bc
(DOCS-13945): Read/Write concern not honored on local db
Nov 16, 2020
9846acb
DOCS-13806, DOCS-13241, DOCSP-12341 update macOS brew install doc
andf-mongodb Aug 4, 2020
15cd5de
DOCS-13959 release 4.4.2
andf-mongodb Nov 18, 2020
d6b8a95
DOCS-13970 release 4.2.11
andf-mongodb Nov 18, 2020
5aee32c
DOCS-13917 forbid manual writes to oplog when replset
andf-mongodb Nov 6, 2020
eaec9b0
DOCS-13778 Add pipeline, arrayFilters metrics to serverStatus
mungitoperrito Oct 21, 2020
5e0a3fe
DOCS-13959 add back missing 4.4.2 tickets to changelog
andf-mongodb Nov 18, 2020
4101486
raise issue limit for changelog script
Nov 19, 2020
372d0ee
DOCS-13846 error message for createIndex
mungitoperrito Nov 17, 2020
e35007b
DOCS-13846 fix code-block intendation
andf-mongodb Nov 20, 2020
540fddf
DOCS-13977 clarify serverStatus.network ingress only
andf-mongodb Nov 20, 2020
062e75f
DOCSP-13287 explicit CSFLE docs reference automatic CSFLE erroneously
andf-mongodb Nov 20, 2020
0aec0a5
DOCS-13995 refresh 4.2.11 changelog
andf-mongodb Nov 23, 2020
8a32b9d
DOCSP-11591 update SELinux FTDC note, still required
andf-mongodb Nov 23, 2020
c239c19
DOCSP-13255 fix TLS enchange private key
andf-mongodb Nov 20, 2020
ea19078
(DOCS-13867): filter for profiler
Oct 29, 2020
55543d9
DOCSP-13402 add drop unique system index step to 4.2 downg instructions
andf-mongodb Nov 30, 2020
3a8a69c
DOCSP-13412 remove :samp: directive from manual
andf-mongodb Dec 1, 2020
36318b7
(DOCS-14025): Fix sort order for objects
Dec 1, 2020
a96841f
DOCS-13983 platform support add AMZN Linux2 3.6 foreport
andf-mongodb Dec 4, 2020
c7567f8
DOCS-9994,DOCSP-13487 document sort stability change in v4.4
andf-mongodb Dec 4, 2020
409ff41
DOCSP-11905 updates ObjectId entry in reference glossary
jmd-mongo Dec 3, 2020
e41f067
DOCS-13885 add sampleRate match operator
mungitoperrito Nov 20, 2020
d1c98d5
DOCSP-13192 provide greater detail on the round-to-even method
mungitoperrito Dec 2, 2020
9052494
Revert "DOCSP-9411 add warning re dropped indexes during replication"
mungitoperrito Dec 9, 2020
f9be5a8
DOCSP-13571 add missing default for systemLog params
andf-mongodb Dec 9, 2020
e24baab
DOCSP-13116 oplog space reclamation might require restart
jmd-mongo Dec 8, 2020
736667b
DOCSP-13116 oplog space reclamation might require restart
jmd-mongo Dec 8, 2020
f5fd62e
remove reference to natural
asya999 Dec 4, 2020
ef5255f
Update cursor.skip.txt
asya999 Dec 8, 2020
043afca
Update cursor.skip.txt
asya999 Dec 8, 2020
5e75d59
DOCSP-13532 extend DOCS-9994 to cursor.limit() and cursor.skip()
andf-mongodb Dec 7, 2020
caba839
DOCSP-13615 fix balancing shard by country example
andf-mongodb Dec 14, 2020
03fed32
DOCSP-13625 fix formatting on $expr behavior section
andf-mongodb Dec 15, 2020
4c148cd
DOCSP-13627 correct typo findAndModify upsert
andf-mongodb Dec 15, 2020
631df97
DOCSP-13579 clean up inconsistent formating of subsections
mungitoperrito Dec 9, 2020
ac03311
DOCS-14061 generate initial changelog for 4.0.22
andf-mongodb Dec 16, 2020
1ca8a2c
DOCS-14062 generate initial changelog for 4.4.3
andf-mongodb Dec 16, 2020
bd108e0
DOCSP-13652 fix subject verb agreement error
mungitoperrito Dec 16, 2020
a442cb5
DOCSP-13972 clean shutdown notice for v4.4 downgrade docs
jmd-mongo Dec 15, 2020
4a75972
DOCS-14053 sampleRate misclassified as stage
mungitoperrito Dec 14, 2020
b5c9a23
DOCSP-13712 replace term relative for pwd()
andf-mongodb Dec 22, 2020
7a06636
DOCS-14049 "Index Intersection and Sort" clarification
jmd-mongo Dec 21, 2020
f9addbf
DOCSP-13725 update returns section with array name
andf-mongodb Dec 28, 2020
f1eac0a
DOCSP-13735 add empty array result for setIntersection
andf-mongodb Dec 28, 2020
87b412d
DOCSP-13710 monotonically changing shard keys
jmd-mongo Dec 22, 2020
21f16e4
DOCS-14070 finalize and release 4.4.3 changelog
andf-mongodb Jan 4, 2021
4017884
DOCS-14069 finalize and release 4.0.22 changelog
andf-mongodb Jan 4, 2021
a402645
DOCS-13985 clarifies when compound indexes can contain a hashed index…
jmd-mongo Dec 29, 2020
63fb637
(DOCS-11033): Add limitation for 3.2 and earlier multikey indexes
jeff-allen-mongo Jan 8, 2021
cb05ef5
DOCS-14070 refresh 4.4.3 changelog +7d
andf-mongodb Jan 11, 2021
e30d35a
DOCS-14043 change field to notPrimaryUnacknowledgedWrites
mungitoperrito Dec 29, 2020
a036613
DOCS-14042 change field to notPrimaryLegacyUnacknowledgedWrites
mungitoperrito Dec 29, 2020
fcfca6e
DOCSP-13914 fix broken spidermonkey links, 3.2 and 2.4 legacy
andf-mongodb Jan 12, 2021
b1faa52
DOCSP-13616 deemphasize alternate windows install method crosslinks
andf-mongodb Jan 12, 2021
b335602
DOCS-13883 add random number generator
mungitoperrito Dec 29, 2020
1e70951
DOCSP-13944 clarify _id resumeToken definition for change streams
andf-mongodb Jan 13, 2021
75f8b5a
DOCS-13981 clarify read preference nearest
andf-mongodb Jan 13, 2021
24ab696
DOCS-14121 generate initial changelog for 4.2.12
andf-mongodb Jan 14, 2021
f47e1d8
DOCS-14051 Documentation for sinh cosh tanh
jason-price-mongodb Dec 17, 2020
e184064
DOCS-13883 Update left nav index
mungitoperrito Jan 14, 2021
719001f
DOCSP-13999 correct typo cp restore backup
andf-mongodb Jan 19, 2021
88d142f
DOCS-14050 ShardingTaskExecutorPool* params are also applicable to mo…
jmd-mongo Jan 6, 2021
4a3c776
DOCS-14137 finalize and release 4.2.12 changelog
andf-mongodb Jan 23, 2021
9c96655
DOCSP-13698 Index Intersection is rarely chosen by the query planner
jmd-mongo Jan 22, 2021
b758870
DOCS-14153 remove single CA requirement x509
andf-mongodb Jan 25, 2021
983bead
DOCS-14048 mapReduce refactoring
jason-price-mongodb Jan 8, 2021
fe95d92
DOCSP-14170 clarify TTL index requirements
andf-mongodb Jan 27, 2021
6f86246
DOCSP-14120 add macos security note mongo shell
andf-mongodb Jan 27, 2021
d93d382
DOCS-14070 refresh 4.4.3 changelog
andf-mongodb Jan 29, 2021
bb65eef
DOCS-14162 generate initial 3.6.22 changelog
andf-mongodb Feb 1, 2021
680cbad
DOCSP-13618 clarify that shutdown only applies to Linux; kill applies…
jmd-mongo Jan 29, 2021
f66a118
update link and description to drivers landing page
Feb 2, 2021
eac6fac
DOCS-13741 add warning to ttlMonitorEnabled param
andf-mongodb Feb 1, 2021
b612281
DOCS-14143,DOCSP-8696,DOCSP-14087 macOS brew conf file location apple…
andf-mongodb Jan 21, 2021
c5435b6
DOCSP-14358 update changelog script with new component
andf-mongodb Feb 4, 2021
2400c7a
DOCSP-14340 unlink section header
andf-mongodb Feb 4, 2021
7ffc5ce
DOCS-14186 generate initial 4.4.4 changelog
andf-mongodb Feb 4, 2021
80b852a
DOP-1883: adding trailing / to reduce redirect chain probability
schmalliso Feb 4, 2021
88caec7
add missing trailing /
schmalliso Feb 4, 2021
c2643ae
DOCS-14198 finalize and release 3.6.22 changelog
andf-mongodb Feb 8, 2021
875bf61
DOCSP-13537 foreport DOCS-13983 AMZN2 support in 3.6.22
andf-mongodb Feb 8, 2021
9f80644
DOCSP-14387 Removing incorrect example
asya999 Feb 7, 2021
eaffe6d
DOCSP-13696 correct sort stability language
andf-mongodb Dec 29, 2020
77c53ce
DOCSP-13968 update $rand with new examples
mungitoperrito Jan 22, 2021
0bce89a
DOCS-14182 clarify retryable writes default
andf-mongodb Feb 9, 2021
7693f23
DOCS-14212 generate initial changelog for 4.0.23
andf-mongodb Feb 11, 2021
6f4f309
DOCS-14175 Platform Support add AMZN2 ARM64
andf-mongodb Feb 16, 2021
f8252c7
DOCS-13988 platform support: add RHEL8 ARM64
andf-mongodb Dec 2, 2020
150f6c7
DOCS-14220 finalize and release 4.4.4 changelog
andf-mongodb Feb 16, 2021
58b9742
(DOCSP-14561): replace kmsProvider with kmsProviders
jeff-allen-mongo Feb 16, 2021
6d3873e
Fixes capitalization of tls config section (TLS: -> tls:)
jmd-mongo Feb 16, 2021
ecbddef
Remove incorrect TTL reference
asya999 Jan 6, 2021
405e22a
DOCSP-14490 update v4.4 known issues
andf-mongodb Feb 17, 2021
7636e96
DOCS-14078 update rangeDeleterBatchSize default value
andf-mongodb Jan 12, 2021
5d2918f
Update build var to v4.4.4
andf-mongodb Feb 17, 2021
2e36759
DOCSP-14697 correct CSFLE KMS page typos
andf-mongodb Feb 18, 2021
c4d07a7
DOCSP-13748 clarify numInitialChunk meaning
npentrel Feb 1, 2021
cba56ca
DOCS-14222 deprecates getnonce command
jmd-mongo Feb 16, 2021
f437a68
DOCSP-14457 fix deployments space typo
andf-mongodb Feb 22, 2021
74fcbd8
DOCSP-14729 update mentions command-line tools
andf-mongodb Feb 22, 2021
d486854
DOCS-14234 finalize and release 4.0.23 changelog
andf-mongodb Feb 22, 2021
c1005c6
DOCS-9801 advise backing up FTDC data before resync
andf-mongodb Feb 22, 2021
9bd93ea
DOCS-14180 replica sets should use setDefaultRWConcern to modify defa…
jmd-mongo Feb 19, 2021
6e9069a
DOCS-14160 fix expr operators missing header row
andf-mongodb Feb 24, 2021
1bdb78d
DOCS-14250 fix cmp operators missing header row
andf-mongodb Feb 24, 2021
dca2014
DOCS-14256 generate initial 4.2.13 changelog
andf-mongodb Feb 26, 2021
e4145d7
DOCS-13884 Log profiler changes
jason-price-mongodb Feb 16, 2021
60b3966
DOCSP-13972 clarify keyID array of single UUID
andf-mongodb Feb 22, 2021
7d5ef36
DOCSP-14293 correct enableEncryption no argument
andf-mongodb Feb 26, 2021
737a14f
(DOCSP-14537): Clarify keyVaultClient description
jeff-allen-mongo Feb 24, 2021
3fe81c6
DOCSP-14923 fix deprecated directive for NextGen
andf-mongodb Mar 1, 2021
fb8bd8c
DOCS-13229 correct merge behavior sharded cluster
andf-mongodb Feb 16, 2021
308855d
DOCS-14134 fix positional projection array behavior
andf-mongodb Feb 16, 2021
b7e0f78
DOCS-10193 update missing libsasl2 dependencies deb
andf-mongodb Feb 25, 2021
520c9f3
DOCSP-7100 logRotate also rotates audit log
andf-mongodb Mar 3, 2021
68fa0b3
DOCS-14266 connection string multiples typo
andf-mongodb Mar 4, 2021
855911d
DOCS-14213 printSecondaryReplicationInfo not documented
jason-price-mongodb Mar 2, 2021
bf41eb5
DOP-1883: unchain the 3.2/3.4 sharding redirects
schmalliso Mar 10, 2021
9a10888
trivial: fix UL formatting
andf-mongodb Mar 10, 2021
6f06cf0
DOCS-14278 generate initial 3.6.23 changelog
andf-mongodb Mar 10, 2021
a08a2ae
DOCSP-14880 Create shell page for Atlas Search
kanchana-mongodb Mar 1, 2021
21c8c4f
DOCS-14284 fix start snmpd step Linux
andf-mongodb Mar 11, 2021
ac839be
DOCS-13922 describes procedure for renaming replica sets
jmd-mongo Feb 25, 2021
96ce4be
DOCS-14299 finalize release 4.2.13 changelog
andf-mongodb Mar 19, 2021
2373576
DOCS-14298 finalize release 3.6.23 changelog
andf-mongodb Mar 19, 2021
28d2211
DOCSP-14536 Platform Support: AMZN2 ARM64 support
andf-mongodb Mar 19, 2021
debee73
Add missing words in Access Control text
jmikola Mar 5, 2021
d00c93d
DOCS-13725 update cursor snapshot documentation
npentrel Mar 23, 2021
d5f6df5
(DOCSP-15221): Add redirect for hashed indexes
jeff-allen-mongo Mar 23, 2021
580ecd1
DOCS-13943 Add plan cache limit and stats
npentrel Mar 16, 2021
b19ae0e
DOCSP-15247 fix Atlas agg pipeline link
andf-mongodb Mar 23, 2021
08887c4
(DOCSP-13152): Improve Atlas Search callouts
jeff-allen-mongo Feb 10, 2021
71d8a75
Update index-tutorials-considerations.rst
iMacTia Mar 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -3252,6 +3252,11 @@ file_filter = locale/<lang>/LC_MESSAGES/reference/method/db.cloneCollection.po
source_file = locale/pot/reference/method/db.cloneCollection.pot
source_lang = en

[mongodb-manual.reference--method--db_printSecondaryReplicationInfo]
file_filter = locale/<lang>/LC_MESSAGES/reference/method/db.printSecondaryReplicationInfo.po
source_file = locale/pot/reference/method/db.printSecondaryReplicationInfo.pot
source_lang = en

[mongodb-manual.reference--method--db_printSlaveReplicationInfo]
file_filter = locale/<lang>/LC_MESSAGES/reference/method/db.printSlaveReplicationInfo.po
source_file = locale/pot/reference/method/db.printSlaveReplicationInfo.pot
Expand Down Expand Up @@ -4087,6 +4092,11 @@ file_filter = locale/<lang>/LC_MESSAGES/reference/method/db.collection.copyTo.po
source_file = locale/pot/reference/method/db.collection.copyTo.pot
source_lang = en

[mongodb-manual.reference--method--rs_printSecondaryReplicationInfo]
file_filter = locale/<lang>/LC_MESSAGES/reference/method/rs.printSecondaryReplicationInfo.po
source_file = locale/pot/reference/method/rs.printSecondaryReplicationInfo.pot
source_lang = en

[mongodb-manual.reference--method--rs_printSlaveReplicationInfo]
file_filter = locale/<lang>/LC_MESSAGES/reference/method/rs.printSlaveReplicationInfo.po
source_file = locale/pot/reference/method/rs.printSlaveReplicationInfo.pot
Expand Down
2 changes: 1 addition & 1 deletion changelogs/generatechangelogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get_jira_issues(fixVersion):
# Run the JIRA query
query = "project in {0} and fixVersion = {1} and resolution = 'Fixed' ORDER BY key ASC".format(
projects, fixVersion)
issues = auth_jira.search_issues(query, maxResults=200)
issues = auth_jira.search_issues(query, maxResults=500)

logger.info("building changelog for {0} with {1} issue(s)".format(
fixVersion, len(issues)))
Expand Down
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def has(self, *args):
])

source_constants = {
'version-dev': '4.9', # Current development branch
'version-dev': '4.3', # Current development branch
'package-name-org': 'mongodb-org',
'package-name-enterprise': 'mongodb-enterprise',
'version': version,
Expand Down
4 changes: 2 additions & 2 deletions config/build_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ project:
branched: true
siteroot: true
version:
release: '5.0.0'
branch: '5.0'
release: '4.4.4'
branch: '4.4'
system:
files:
- 'pdfs.yaml'
Expand Down
1 change: 1 addition & 0 deletions config/changelog_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ groups:
- Mobile
"Internals":
- Testing
- Python tests
- Testing Infrastructure
- Stability
- Performance
Expand Down
3,186 changes: 1,598 additions & 1,588 deletions config/redirects

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion config/sphinx_local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ theme:
- /release-notes/4.0
- /release-notes/4.2
- /release-notes/4.4
- /release-notes/5.0
- /security
- /sharding
- /changeStreams
Expand Down
6 changes: 3 additions & 3 deletions snooty.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name = "manual"

[constants]
package-branch = "5.0" # For rc = testing. For GA, will be 4.2.
windows-dir-version = "5.0" # The wizard installs in 4.2 branch
package-branch = "4.4" # For rc = testing. For GA, will be 4.2.
windows-dir-version = "4.4" # The wizard installs in 4.2 branch
package-name-org = "mongodb-org"
package-name-enterprise = "mongodb-enterprise"
version = "5.0"
version = "4.4"
release = "{+release+}"
pgp-version = "{+version+}"
pgp-fingerprint = "E162F504A20CDF15827F718D4B7C549A058F8B6B"
Expand Down
19 changes: 4 additions & 15 deletions source/administration/configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,9 @@ best-practice configurations for common use cases.

While both interfaces provide access to the same collection of options
and settings, this document primarily uses the configuration file
interface. If you installed MongoDB with a package manager such as
``yum`` or ``apt`` on Linux, or ``brew`` on macOS, a default
:doc:`configuration file </reference/configuration-options>` has been
provided as part of your installation:
interface.

- On Linux, a default :file:`/etc/mongod.conf` configuration file is
included when using a package manager to install MongoDB.

- On Windows, a default :file:`<install directory>/bin/mongod.cfg`
configuration file is included during the installation.

- On macOS, a default :file:`/usr/local/etc/mongod.conf`
configuration file is included when installing from MongoDB's
official Homebrew tap.
.. include:: /includes/fact-default-conf-file.rst

For package installations of MongoDB on Linux or macOS, an
initialization script which uses this default configuration file is also
Expand Down Expand Up @@ -67,14 +56,14 @@ to create your own configuration file. A
this document. Once you have created a configuration file, you can start
a MongoDB instance with this configuration file by using either the
:option:`--config <mongod --config>` or :option:`-f <mongod --config>`
options to :binary:`~bin.mongod`:
options to :binary:`~bin.mongod`. For example, on Linux:

.. code-block:: sh

mongod --config /etc/mongod.conf
mongod -f /etc/mongod.conf

Modify the values in the ``/etc/mongod.conf`` file on your system to
Modify the values in the ``mongod.conf`` file on your system to
control the configuration of your database instance.

.. _base-config:
Expand Down
10 changes: 1 addition & 9 deletions source/administration/production-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Recommended Platforms
~~~~~~~~~~~~~~~~~~~~~

While MongoDB supports a variety of platforms, the following operating
systems are recommended for production use:
systems are recommended for production use on ``x86_64`` architecture:

- Amazon Linux 2
- Debian 9 and 10
Expand Down Expand Up @@ -643,14 +643,6 @@ operations like the following:
- Features which rely on timekeeping may have inconsistent or
unpredictable behavior in clusters with clock drift between MongoDB
components.

For example, :ref:`TTL indexes <index-feature-ttl>` rely
on the system clock to calculate when to delete a given document. If
two members have different system clock times, each member could
delete a given document covered by the TTL index at a different
time. Since :ref:`sessions` use TTL indexes to control their
lifespan, clock drift could result in inconsistent or unpredictable
session timeout behavior.

NTP synchronization is required for deployments running MongoDB lower
than ``3.4.6`` or ``3.2.17`` with the Wired Tiger storage engine, where
Expand Down
4 changes: 4 additions & 0 deletions source/administration/replica-set-maintenance.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ replica sets.
:doc:`/tutorial/configure-replica-set-secondary-sync-target`
Specify the member that a secondary member synchronizes from.

:doc:`/tutorial/rename-unsharded-replica-set`
Rename an unsharded replica set.


.. toctree::
:titlesonly:
Expand All @@ -65,3 +68,4 @@ replica sets.
/tutorial/manage-chained-replication
/tutorial/change-hostnames-in-a-replica-set
/tutorial/configure-replica-set-secondary-sync-target
/tutorial/rename-unsharded-replica-set
35 changes: 10 additions & 25 deletions source/aggregation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ transforms the documents into an aggregated result. For example:

<video style="width:100%;" src="_images/agg-pipeline.mp4" controls> </video>

In the example,
In the example:

.. code-block:: javascript

Expand Down Expand Up @@ -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 </core/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 </core/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
Expand All @@ -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
---------------------------------

Expand Down
13 changes: 10 additions & 3 deletions source/core/aggregation-pipeline-sharded-collections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@ to be done on the primary shard.
.. versionchanged:: 3.6

When aggregation operations run on multiple shards, the results are
routed to the :binary:`~bin.mongos` to be merged. However, :pipeline:`$out`
and :pipeline:`$lookup` must run on the :ref:`primary shard <primary-shard>`
and are aggregated there.
routed to the :binary:`~bin.mongos` to be merged, except in the
following cases:

- If the pipeline includes the :pipeline:`$out` or
:pipeline:`$lookup` stages, the merge runs on the
:ref:`primary shard <primary-shard>`.

- If the pipeline includes a sorting or grouping stage, and the
:ref:`allowDiskUse <aggregate-cmd-allowDiskUse>` setting is enabled,
the merge runs on a randomly-selected shard.

Optimization
------------
Expand Down
60 changes: 24 additions & 36 deletions source/core/aggregation-pipeline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ results. For example:

<video style="width:100%;" src="../_images/agg-pipeline.mp4" controls> </video>

In the example,
In the example:

.. code-block:: javascript

Expand All @@ -53,8 +53,8 @@ Pipeline

The MongoDB aggregation pipeline consists of :ref:`stages
<aggregation-pipeline-operator-reference>`. 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
Expand Down Expand Up @@ -98,11 +98,11 @@ by the aggregation process with one exception: :ref:`accumulator
<aggregation-accumulator-operators>` 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
Expand Down Expand Up @@ -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 </core/map-reduce>`.
Aggregation Pipeline Optimization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Various map-reduce operations can be rewritten using :doc:`aggregation
pipeline operators </meta/aggregation-quick-reference>`, 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:
Expand Down
2 changes: 1 addition & 1 deletion source/core/data-modeling-introduction.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Flexible Schema

Unlike SQL databases, where you must determine and declare a table's
schema before inserting data, MongoDB's :term:`collections
<collection>`, by default, does not require its :doc:`documents
<collection>`, by default, do not require their :doc:`documents
</core/document>` to have the same schema. That is:

- The documents in a single collection do not need to have the same set
Expand Down
20 changes: 16 additions & 4 deletions source/core/index-compound.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,22 @@ operation that resembles the following prototype:

.. include:: /includes/fact-index-specification-field-value.rst

.. important:: You may not create compound indexes that have
``hashed`` index type. You will receive an error if you attempt to
create a compound index that includes :doc:`a hashed index
field </core/index-hashed>`.
.. important::

Starting in MongoDB 4.4:

- Compound indexes may contain **a single** :doc:`hashed index field
</core/index-hashed>`.
- You will receive an error if you attempt to create a compound index
that contains more than one :doc:`hashed index field
</core/index-hashed>`.

In MongoDB 4.2 or earlier:

- Compound indexes may **not** contain a :doc:`hashed index field
</core/index-hashed>`.
- You will receive an error if you attempt to create a compound index
that contains a :doc:`hashed index field </core/index-hashed>`.

Consider a collection named ``products`` that holds documents that
resemble the following document:
Expand Down
Loading