diff --git a/config/migrations.yaml b/config/migrations.yaml
index da74e10a942..2c05f9dfc51 100644
--- a/config/migrations.yaml
+++ b/config/migrations.yaml
@@ -10,7 +10,7 @@ dependency:
# - $(public-output)/manual
- links
command: "fab generate.sitemap"
-message: "[sitemap]: sitemap build complete at `date`."
+message: "[sitemap]: sitemap build complete at ``date``."
action: cmd
---
# target: '$(public-output)/manual'
diff --git a/draft/use-cases/ad-campaign-management.txt b/draft/use-cases/ad-campaign-management.txt
index 85851636af2..71a3f7bc417 100644
--- a/draft/use-cases/ad-campaign-management.txt
+++ b/draft/use-cases/ad-campaign-management.txt
@@ -145,5 +145,7 @@ TODO: describe indexes to optimize this query
Sharding
--------
-.. seealso:: ":doc:`/faq/sharding`" and the ":wiki:`Sharding` wiki
+.. seealso::
+
+ ":doc:`/faq/sharding`" and the ":wiki:`Sharding` wiki
page.
diff --git a/draft/use-cases/social-networking-updates-and-profiles.txt b/draft/use-cases/social-networking-updates-and-profiles.txt
index b209417a3d4..097ec7fc533 100644
--- a/draft/use-cases/social-networking-updates-and-profiles.txt
+++ b/draft/use-cases/social-networking-updates-and-profiles.txt
@@ -648,5 +648,7 @@ on ``_id``, then, you'll need to execute the following command:
... 'key': {'_id': 1 } } )
{ "collectionsharded": "social.post", "ok": 1 }
-.. seealso:: ":doc:`/faq/sharding`" and the ":wiki:`Sharding` wiki
+.. seealso::
+
+ ":doc:`/faq/sharding`" and the ":wiki:`Sharding` wiki
page.
diff --git a/snooty.toml b/snooty.toml
index 4534449d385..8c4c550e868 100644
--- a/snooty.toml
+++ b/snooty.toml
@@ -1,4 +1,190 @@
-name = "manual"
+name = "docs"
+title = "MongoDB Manual"
+
+intersphinx = [ "https://pymongo.readthedocs.io/en/stable/objects.inv",
+ "https://motor.readthedocs.io/en/stable/objects.inv",
+ "https://docs.atlas.mongodb.com/objects.inv",
+ "https://docs.mongodb.com/php-library/master/objects.inv",
+ "https://docs.mongodb.com/compass/current/objects.inv",
+ "https://docs.mongodb.com/database-tools/objects.inv"
+ ]
+
+# toc_landing_pages are pages that have pages nested beneath them
+# and **should** open when a user clicks on that page in the TOC
+# (i.e. they're not drawers)
+toc_landing_pages = [
+ "/administration",
+ "/administration/analyzing-mongodb-performance",
+ "/administration/backup-sharded-clusters",
+ "/administration/configuration-and-maintenance",
+ "/administration/install-community",
+ "/administration/install-enterprise-linux",
+ "/administration/install-enterprise",
+ "/administration/install-on-linux/",
+ "/administration/monitoring",
+ "/administration/replica-set-deployment",
+ "/administration/replica-set-maintenance",
+ "/administration/replica-set-member-configuration",
+ "/administration/sharded-cluster-administration",
+ "/administration/sharded-cluster-config-servers",
+ "/administration/upgrade-community-to-enterprise",
+ "/aggregation",
+ "/applications/indexes",
+ "/applications/replication",
+ "/changeStreams",
+ "/core/2d",
+ "/core/2dsphere",
+ "/core/aggregation-pipeline",
+ "/core/auditing",
+ "/core/authentication-mechanisms-enterprise",
+ "/core/authentication-mechanisms",
+ "/core/authentication",
+ "/core/authorization",
+ "/core/backups",
+ "/core/crud",
+ "/core/databases-and-collections",
+ "/core/geohaystack",
+ "/core/index-creation",
+ "/core/index-multikey",
+ "/core/index-text",
+ "/core/index-ttl",
+ "/core/index-wildcard",
+ "/core/journaling",
+ "/core/kerberos",
+ "/core/map-reduce",
+ "/core/query-optimization",
+ "/core/read-isolation-consistency-recency",
+ "/core/read-preference",
+ "/core/replica-set-architectures",
+ "/core/replica-set-high-availability",
+ "/core/replica-set-members",
+ "/core/replica-set-secondary",
+ "/core/security-automatic-client-side-encryption",
+ "/core/security-client-side-encryption-key-management",
+ "/core/security-client-side-encryption",
+ "/core/security-encryption-at-rest",
+ "/core/security-hardening",
+ "/core/security-internal-authentication",
+ "/core/security-ldap",
+ "/core/security-transport-encryption",
+ "/core/security-users",
+ "/core/security-x.509",
+ "/core/sharded-cluster-components",
+ "/core/sharding-balancer-administration",
+ "/core/sharding-data-partitioning",
+ "/core/storage-engines",
+ "/core/transactions",
+ "/core/wiredtiger",
+ "/core/zone-sharding",
+ "/core/zone-sharding",
+ "/crud",
+ "/geospatial-queries",
+ "/indexes",
+ "/installation",
+ "/introduction",
+ "/mongo",
+ "/reference/aggregation",
+ "/reference/bson-types",
+ "/reference/collation",
+ "/reference/command",
+ "/reference/command/nav-administration",
+ "/reference/command/nav-aggregation",
+ "/reference/command/nav-auditing",
+ "/reference/command/nav-authentication",
+ "/reference/command/nav-crud",
+ "/reference/command/nav-diagnostic",
+ "/reference/command/nav-free-monitoring",
+ "/reference/command/nav-geospatial",
+ "/reference/command/nav-plan-cache",
+ "/reference/command/nav-replication",
+ "/reference/command/nav-role-management",
+ "/reference/command/nav-sessions",
+ "/reference/command/nav-sharding",
+ "/reference/command/nav-user-management",
+ "/reference/configuration-options",
+ "/reference/method",
+ "/reference/method/js-bulk",
+ "/reference/method/js-client-side-field-level-encryption",
+ "/reference/method/js-collection",
+ "/reference/method/js-connection",
+ "/reference/method/js-constructor",
+ "/reference/method/js-cursor",
+ "/reference/method/js-database",
+ "/reference/method/js-free-monitoring",
+ "/reference/method/js-native",
+ "/reference/method/js-plan-cache",
+ "/reference/method/js-replication",
+ "/reference/method/js-role-management",
+ "/reference/method/js-sharding",
+ "/reference/method/js-user-management",
+ "/reference/operator/aggregation-pipeline",
+ "/reference/operator/aggregation",
+ "/reference/operator/query-array",
+ "/reference/operator/query-bitwise",
+ "/reference/operator/query-comparison",
+ "/reference/operator/query-element",
+ "/reference/operator/query-evaluation",
+ "/reference/operator/query-geospatial",
+ "/reference/operator/query-logical",
+ "/reference/operator/query-miscellaneous",
+ "/reference/operator/query-modifiers",
+ "/reference/operator/query-projection",
+ "/reference/operator/query",
+ "/reference/operator/update-array",
+ "/reference/operator/update-bitwise",
+ "/reference/operator/update-field",
+ "/reference/operator/update",
+ "/reference/read-concern",
+ "/reference/replication",
+ "/reference/security",
+ "/reference/sharding",
+ "/release-notes/2.4",
+ "/release-notes/2.6",
+ "/release-notes/3.0",
+ "/release-notes/3.2-compatibility",
+ "/release-notes/3.2",
+ "/release-notes/3.4-downgrade",
+ "/release-notes/3.4",
+ "/release-notes/3.6",
+ "/release-notes/4.0",
+ "/release-notes/4.2-downgrade",
+ "/release-notes/4.2",
+ "/release-notes/4.4-downgrade",
+ "/release-notes/4.4",
+ "/replication",
+ "/security",
+ "/sharding",
+ "/storage",
+ "/text-search",
+ "/tutorial/insert-documents",
+ "/tutorial/install-mongodb-enterprise-on-amazon",
+ "/tutorial/install-mongodb-enterprise-on-debian",
+ "/tutorial/install-mongodb-enterprise-on-macos",
+ "/tutorial/install-mongodb-enterprise-on-red-hat",
+ "/tutorial/install-mongodb-enterprise-on-suse",
+ "/tutorial/install-mongodb-enterprise-on-ubuntu",
+ "/tutorial/install-mongodb-enterprise-on-windows",
+ "/tutorial/install-mongodb-on-amazon",
+ "/tutorial/install-mongodb-on-debian",
+ "/tutorial/install-mongodb-on-macos",
+ "/tutorial/install-mongodb-on-red-hat",
+ "/tutorial/install-mongodb-on-suse",
+ "/tutorial/install-mongodb-on-ubuntu",
+ "/tutorial/install-mongodb-on-windows",
+ "/tutorial/query-documents",
+ "/tutorial/remove-documents",
+ "/tutorial/update-documents"
+]
+
+[substitutions]
+compass = "MongoDB Compass"
+mdb-shell = "MongoDB Shell"
+copy = "©"
+ent-build = "MongoDB Enterprise"
+year = "2020"
+bi = "MongoDB Connector for BI"
+version = "4.2"
+
[constants]
package-branch = "5.0" # For rc = testing. For GA, will be 4.2.
@@ -6,11 +192,11 @@ windows-dir-version = "5.0" # The wizard installs in 4.2 branch
package-name-org = "mongodb-org"
package-name-enterprise = "mongodb-enterprise"
version = "5.0"
-release = "{+release+}"
+release = "5.0"
pgp-version = "{+version+}"
-pgp-fingerprint = "E162F504A20CDF15827F718D4B7C549A058F8B6B"
rsa-key = "4B7C549A058F8B6B"
+pgp-fingerprint = "E162F504A20CDF15827F718D4B7C549A058F8B6B"
pgp-fingerprint-fmt = "E162 F504 A20C DF15 827F 718D 4B7C 549A 058F 8B6B"
-windows-sha256 = "C777DF7816BB8C9A760FDEA782113949408B6F39D72BE29A2551FA51E2FE0473"
pgp-short-fingerprint = "0x4B7C549A058F8B6B"
-source-available = "`source available and free to use `_"
+windows-sha256 = "C777DF7816BB8C9A760FDEA782113949408B6F39D72BE29A2551FA51E2FE0473"
+source-available = ":github:`source available and free to use `"
diff --git a/source/about.txt b/source/about.txt
index 123431f1ad1..678e81b3391 100644
--- a/source/about.txt
+++ b/source/about.txt
@@ -37,11 +37,6 @@ Manual. You can see the full revision history and track ongoing
improvements and additions for all versions of the manual from its `GitHub
repository `_.
-This edition reflects "|branch|" branch of the documentation
-as of the "|commit|" revision. This branch is explicitly accessible
-via "|hardlink|" and you can always reference the commit of the
-current manual in the :hardlink:`release.txt` file.
-
The most up-to-date, current, and stable version of the manual is
always available at "https://docs.mongodb.com/manual/".
diff --git a/source/administration/analyzing-mongodb-performance.txt b/source/administration/analyzing-mongodb-performance.txt
index 6eec128496a..fc1a157d439 100644
--- a/source/administration/analyzing-mongodb-performance.txt
+++ b/source/administration/analyzing-mongodb-performance.txt
@@ -47,11 +47,11 @@ affecting your performance, refer to the :ref:`server-status-locks`
section and the :ref:`globalLock` section of the
:dbcommand:`serverStatus` output.
-Dividing :serverstatus:`locks.timeAcquiringMicros` by
-:serverstatus:`locks.acquireWaitCount`
+Dividing :serverstatus:`locks..timeAcquiringMicros` by
+:serverstatus:`locks..acquireWaitCount`
can give an approximate average wait time for a particular lock mode.
-:serverstatus:`locks.deadlockCount` provide
+:serverstatus:`locks..deadlockCount` provide
the number of times the lock acquisitions encountered deadlocks.
If :serverstatus:`globalLock.currentQueue.total` is consistently high,
@@ -156,8 +156,7 @@ processes run with FTDC on by default. For more information on MongoDB
Support options, visit
`Getting Started With MongoDB Support `_.
-.. admonition:: FTDC Privacy
- :class: important
+.. important:: FTDC Privacy
FTDC data files are compressed and not human-readable. MongoDB Inc.
engineers cannot access FTDC data without explicit permission
diff --git a/source/administration/backup-sharded-clusters.txt b/source/administration/backup-sharded-clusters.txt
index f4f684bd55d..650c4312311 100644
--- a/source/administration/backup-sharded-clusters.txt
+++ b/source/administration/backup-sharded-clusters.txt
@@ -4,9 +4,6 @@ Backup and Restore Sharded Clusters
.. default-domain:: mongodb
-.. role:: red(strong)
- :class: text-danger
-
.. contents:: On this page
:local:
:backlinks: none
@@ -19,25 +16,23 @@ The following tutorials describe backup and restoration for sharded clusters:
.. include:: /includes/extracts/sharded-clusters-backup-restore-mongodump-mongorestore-restriction.rst
-.. class:: toc
-
- :doc:`/tutorial/backup-sharded-cluster-with-filesystem-snapshots`
- Use file system snapshots back up each component in the sharded
- cluster individually. The procedure involves stopping the cluster
- balancer. If your system configuration allows file system backups,
- this might be more efficient than using MongoDB tools.
+:doc:`/tutorial/backup-sharded-cluster-with-filesystem-snapshots`
+ Use file system snapshots back up each component in the sharded
+ cluster individually. The procedure involves stopping the cluster
+ balancer. If your system configuration allows file system backups,
+ this might be more efficient than using MongoDB tools.
- :doc:`/tutorial/backup-sharded-cluster-with-database-dumps`
- Create backups using :binary:`~bin.mongodump` to back up each
- component in the cluster individually.
+:doc:`/tutorial/backup-sharded-cluster-with-database-dumps`
+ Create backups using :binary:`~bin.mongodump` to back up each
+ component in the cluster individually.
- :doc:`/tutorial/schedule-backup-window-for-sharded-clusters`
- Limit the operation of the cluster balancer to provide a window
- for regular backup operations.
+:doc:`/tutorial/schedule-backup-window-for-sharded-clusters`
+ Limit the operation of the cluster balancer to provide a window
+ for regular backup operations.
- :doc:`/tutorial/restore-sharded-cluster`
- An outline of the procedure and consideration for restoring an
- *entire* sharded cluster from backup.
+:doc:`/tutorial/restore-sharded-cluster`
+ An outline of the procedure and consideration for restoring an
+ *entire* sharded cluster from backup.
.. toctree::
diff --git a/source/administration/change-streams-production-recommendations.txt b/source/administration/change-streams-production-recommendations.txt
index dd61f3ab705..161533444e7 100644
--- a/source/administration/change-streams-production-recommendations.txt
+++ b/source/administration/change-streams-production-recommendations.txt
@@ -1,4 +1,4 @@
-.. index:: changeStreams notification
+
=========================================
Change Streams Production Recommendations
diff --git a/source/administration/configuration-and-maintenance.txt b/source/administration/configuration-and-maintenance.txt
index e83c57e1801..8351e81d6fa 100644
--- a/source/administration/configuration-and-maintenance.txt
+++ b/source/administration/configuration-and-maintenance.txt
@@ -7,26 +7,24 @@ Configuration and Maintenance
This section describes routine management operations, including
updating your MongoDB deployment's configuration.
-.. class:: toc
+:doc:`/administration/configuration`
+ Outlines common MongoDB configurations and examples of
+ best-practice configurations for common use cases.
- :doc:`/administration/configuration`
- Outlines common MongoDB configurations and examples of
- best-practice configurations for common use cases.
+:doc:`/tutorial/upgrade-revision`
+ Introduces the basic process for upgrading a MongoDB deployment
+ between different minor release versions.
- :doc:`/tutorial/upgrade-revision`
- Introduces the basic process for upgrading a MongoDB deployment
- between different minor release versions.
+:doc:`/tutorial/manage-mongodb-processes`
+ Start, configure, and manage running :binary:`~bin.mongod`
+ process.
- :doc:`/tutorial/manage-mongodb-processes`
- Start, configure, and manage running :binary:`~bin.mongod`
- process.
+:doc:`/tutorial/terminate-running-operations`
+ Stop in progress MongoDB client operations using
+ :method:`db.killOp()` and :method:`~cursor.maxTimeMS()`.
- :doc:`/tutorial/terminate-running-operations`
- Stop in progress MongoDB client operations using
- :method:`db.killOp()` and :method:`~cursor.maxTimeMS()`.
-
- :doc:`/tutorial/rotate-log-files`
- Archive the current log files and start new ones.
+:doc:`/tutorial/rotate-log-files`
+ Archive the current log files and start new ones.
.. toctree::
diff --git a/source/administration/configuration.txt b/source/administration/configuration.txt
index 1b2f852da56..fb377c7dc96 100644
--- a/source/administration/configuration.txt
+++ b/source/administration/configuration.txt
@@ -216,7 +216,9 @@ The following configuration options are useful for limiting access to a
connecting over the ``localhost`` interface for the first time to
create user credentials.
-.. seealso:: :doc:`/security`
+.. seealso::
+
+ :doc:`/security`
Replication and Sharding Configuration
--------------------------------------
@@ -326,7 +328,9 @@ You can specify additional members of the config server replica set by
specifying hostnames and ports in the form of a comma separated list
after the replica set name.
-.. seealso:: The :doc:`/sharding` section of the manual for more
+.. seealso::
+
+ The :doc:`/sharding` section of the manual for more
information on sharding and cluster configuration.
Run Multiple Database Instances on the Same System
@@ -351,7 +355,7 @@ The :setting:`~storage.dbPath` value controls the location of the
:binary:`~bin.mongod` instance's data directory. Ensure that each database
has a distinct and well labeled data directory. The
:setting:`~processManagement.pidFilePath` controls where :binary:`~bin.mongod` process
-places it's :term:`process id ` file. As this tracks the specific
+places it's :term:`process id (PID) ` file. As this tracks the specific
:binary:`~bin.mongod` file, it is crucial that file be unique and well
labeled to make it easy to start and stop these processes.
diff --git a/source/administration/install-community.txt b/source/administration/install-community.txt
index 808ee0abcf7..043afb224d7 100644
--- a/source/administration/install-community.txt
+++ b/source/administration/install-community.txt
@@ -14,20 +14,17 @@ These documents provide instructions to install MongoDB Community Edition.
.. _`MongoDB Download Center`: https://www.mongodb.com/try/download/community?tck=docs_server
+:doc:`Install on Linux `
+ Install MongoDB Community Edition and required dependencies on
+ Linux.
-.. class:: toc
+:doc:`Install on macOS `
+ Install MongoDB Community Edition on macOS systems from MongoDB
+ archives.
- :doc:`Install on Linux `
- Install MongoDB Community Edition and required dependencies on
- Linux.
-
- :doc:`Install on macOS `
- Install MongoDB Community Edition on macOS systems from MongoDB
- archives.
-
- :doc:`Install on Windows `
- Install MongoDB Community Edition on Windows systems and
- optionally start MongoDB as a Windows service.
+:doc:`Install on Windows `
+ Install MongoDB Community Edition on Windows systems and
+ optionally start MongoDB as a Windows service.
.. toctree::
diff --git a/source/administration/install-enterprise-linux.txt b/source/administration/install-enterprise-linux.txt
index 32b1165b9d2..ed78f057667 100644
--- a/source/administration/install-enterprise-linux.txt
+++ b/source/administration/install-enterprise-linux.txt
@@ -7,27 +7,25 @@ Install MongoDB Enterprise on Linux
These documents provide instructions to install MongoDB Enterprise
Edition for supported Linux systems.
-.. class:: toc
+:doc:`Install on Red Hat `
+ Install MongoDB Enterprise and required dependencies on Red Hat
+ Enterprise or CentOS Systems using packages.
- :doc:`Install on Red Hat `
- Install MongoDB Enterprise and required dependencies on Red Hat
- Enterprise or CentOS Systems using packages.
+:doc:`Install on Ubuntu `
+ Install MongoDB Enterprise and required dependencies on Ubuntu
+ Linux Systems using packages.
- :doc:`Install on Ubuntu `
- Install MongoDB Enterprise and required dependencies on Ubuntu
- Linux Systems using packages.
+:doc:`Install on Debian `
+ Install MongoDB Enterprise and required dependencies on Debian
+ Linux Systems using packages.
- :doc:`Install on Debian `
- Install MongoDB Enterprise and required dependencies on Debian
- Linux Systems using packages.
+:doc:`Install on SUSE `
+ Install MongoDB Enterprise and required dependencies on SUSE
+ Enterprise Linux.
- :doc:`Install on SUSE `
- Install MongoDB Enterprise and required dependencies on SUSE
- Enterprise Linux.
-
- :doc:`Install on Amazon `
- Install MongoDB Enterprise and required dependencies on Amazon
- Linux AMI.
+:doc:`Install on Amazon `
+ Install MongoDB Enterprise and required dependencies on Amazon
+ Linux AMI.
.. toctree::
diff --git a/source/administration/install-enterprise.txt b/source/administration/install-enterprise.txt
index efa13f8cb80..c7bccb99d04 100644
--- a/source/administration/install-enterprise.txt
+++ b/source/administration/install-enterprise.txt
@@ -21,21 +21,19 @@ Event Auditing.
.. include:: /includes/fact-macos-snmp.rst
-.. class:: toc
+:doc:`Install on Linux `
+ Install the official builds of MongoDB Enterprise on Linux-based
+ systems.
- :doc:`Install on Linux `
- Install the official builds of MongoDB Enterprise on Linux-based
- systems.
+:doc:`Install on macOS `
+ Install the official build of MongoDB Enterprise on macOS
- :doc:`Install on macOS `
- Install the official build of MongoDB Enterprise on macOS
+:doc:`Install on Windows `
+ Install MongoDB Enterprise on Windows using the ``.msi``
+ installer.
- :doc:`Install on Windows `
- Install MongoDB Enterprise on Windows using the ``.msi``
- installer.
-
- :doc:`Install with Docker `
- Install a MongoDB Enterprise Docker container.
+:doc:`Install with Docker `
+ Install a MongoDB Enterprise Docker container.
.. toctree::
diff --git a/source/administration/install-on-linux.txt b/source/administration/install-on-linux.txt
index ae0c665c5df..b56b6e1e6a3 100644
--- a/source/administration/install-on-linux.txt
+++ b/source/administration/install-on-linux.txt
@@ -17,27 +17,25 @@ Linux distributions. These packages are the preferred way to run
MongoDB. The following guides detail the installation process for these
systems:
-.. class:: toc
+:doc:`Install on Red Hat `
+ Install MongoDB Community Edition on Red Hat Enterprise and
+ related Linux systems using ``.rpm`` packages.
- :doc:`Install on Red Hat `
- Install MongoDB Community Edition on Red Hat Enterprise and
- related Linux systems using ``.rpm`` packages.
+:doc:`Install on Ubuntu `
+ Install MongoDB Community Edition on Ubuntu Linux systems using
+ ``.deb`` packages.
- :doc:`Install on Ubuntu `
- Install MongoDB Community Edition on Ubuntu Linux systems using
- ``.deb`` packages.
+:doc:`Install on Debian `
+ Install MongoDB Community Edition on Debian systems using ``.deb``
+ packages.
- :doc:`Install on Debian `
- Install MongoDB Community Edition on Debian systems using ``.deb``
- packages.
+:doc:`Install on SUSE `
+ Install MongoDB Community Edition on SUSE Linux systems using
+ ``.rpm`` packages.
- :doc:`Install on SUSE `
- Install MongoDB Community Edition on SUSE Linux systems using
- ``.rpm`` packages.
-
- :doc:`Install on Amazon `
- Install MongoDB Community Edition on Amazon Linux AMI systems
- using ``.rpm`` packages.
+:doc:`Install on Amazon `
+ Install MongoDB Community Edition on Amazon Linux AMI systems
+ using ``.rpm`` packages.
.. include:: /includes/admonition-wsl.rst
diff --git a/source/administration/monitoring.txt b/source/administration/monitoring.txt
index d3b12488dc6..c5a45d1c1f7 100644
--- a/source/administration/monitoring.txt
+++ b/source/administration/monitoring.txt
@@ -431,7 +431,7 @@ the following helper in the shell:
The :dbcommand:`replSetGetStatus` reference provides a more in-depth
overview view of this output. In general, watch the value of
-:data:`~replSetGetStatus.members.optimeDate`, and pay particular attention
+:data:`~replSetGetStatus.members[n].optimeDate`, and pay particular attention
to the time difference between the :term:`primary` and the
:term:`secondary` members.
@@ -463,7 +463,9 @@ instances. In addition, clusters require further monitoring to ensure
that data is effectively distributed among nodes and that sharding
operations are functioning appropriately.
-.. seealso:: See the :doc:`/sharding` documentation for more
+.. seealso::
+
+ See the :doc:`/sharding` documentation for more
information.
Config Servers
diff --git a/source/administration/production-notes.txt b/source/administration/production-notes.txt
index 9e7f7c6cddd..1cb1c887d35 100644
--- a/source/administration/production-notes.txt
+++ b/source/administration/production-notes.txt
@@ -13,8 +13,8 @@ Production Notes
This page details system configurations that affect MongoDB,
especially when running in production.
-.. admonition:: MMAPv1 Removed
- :class: warning
+.. warning:: MMAPv1 Removed
+
MongoDB 4.2 removes the deprecated MMAPv1 storage engine. To change
your MMAPv1 storage engine deployment to :doc:`/core/wiredtiger`, see:
@@ -106,23 +106,23 @@ systems are recommended for production use on ``x86_64`` architecture:
- Ubuntu LTS 16.04, 18.04, and 20.04
- Windows Server 2016 and 2019
-.. seealso:: :ref:`prod-notes-platform-considerations`
+.. seealso::
+
+ :ref:`prod-notes-platform-considerations`
Use the Latest Stable Packages
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Be sure you have the latest stable release.
-All MongoDB releases are available on the `MongoDB Download Center`_
-page. The `MongoDB Download Center`_ page is a good place to verify the
+All MongoDB releases are available on the :dl:`MongoDB Download Center <>`
+page. The :dl:`MongoDB Download Center <>` is a good place to verify the
current stable release, even if you are installing via a package
manager.
-For other MongoDB products, refer either to the `MongoDB Download Center`_
+For other MongoDB products, refer either to the :dl:`MongoDB Download Center <>`
page or their `respective documentation `_.
-.. _`MongoDB Download Center`: https://www.mongodb.com/try/download/community?tck=docs_server
-
MongoDB ``dbPath``
------------------
@@ -149,7 +149,9 @@ readers and writers to the documents in a collection. Clients can read
documents while write operations are in progress, and multiple threads
can modify different documents in a collection at the same time.
-.. seealso:: :ref:`prod-notes-ram` provides information about how WiredTiger
+.. seealso::
+
+ :ref:`prod-notes-ram` provides information about how WiredTiger
takes advantage of multiple CPU cores and how to improve operation
throughput.
@@ -296,7 +298,9 @@ If you are using MongoDB Enterprise with the
:ref:`encrypted-storage-engine`, choose a CPU that supports AES-NI for
better performance.
-.. seealso:: :ref:`prod-notes-concurrency`
+.. seealso::
+
+ :ref:`prod-notes-concurrency`
Use Solid State Disks (SSDs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -587,7 +591,9 @@ See :doc:`Sharded Cluster Production Architecture
overview of recommended sharded cluster architectures for production
deployments.
-.. seealso:: :doc:`/administration/production-checklist-development`
+.. seealso::
+
+ :doc:`/administration/production-checklist-development`
Compression
-----------
diff --git a/source/administration/replica-set-deployment.txt b/source/administration/replica-set-deployment.txt
index 846cb1114a2..03687a90b52 100644
--- a/source/administration/replica-set-deployment.txt
+++ b/source/administration/replica-set-deployment.txt
@@ -12,37 +12,35 @@ Replica Set Deployment Tutorials
The following tutorials provide information on deploying replica sets.
-.. class:: toc
+:doc:`/tutorial/deploy-replica-set`
+ Configure a three-member replica set for production systems.
- :doc:`/tutorial/deploy-replica-set`
- Configure a three-member replica set for production systems.
+:doc:`/tutorial/deploy-replica-set-for-testing`
+ Configure a three-member replica set for either development or
+ testing systems.
- :doc:`/tutorial/deploy-replica-set-for-testing`
- Configure a three-member replica set for either development or
- testing systems.
+:doc:`/tutorial/deploy-geographically-distributed-replica-set`
+ Create a geographically redundant replica set to protect against
+ location-centered availability limitations (e.g. network and power
+ interruptions).
- :doc:`/tutorial/deploy-geographically-distributed-replica-set`
- Create a geographically redundant replica set to protect against
- location-centered availability limitations (e.g. network and power
- interruptions).
+:doc:`/tutorial/add-replica-set-arbiter`
+ Add an arbiter to give a replica set an odd number of voting
+ members to prevent election ties.
- :doc:`/tutorial/add-replica-set-arbiter`
- Add an arbiter to give a replica set an odd number of voting
- members to prevent election ties.
+:doc:`/tutorial/convert-standalone-to-replica-set`
+ Convert an existing standalone ``mongod`` instance into a
+ three-member replica set.
- :doc:`/tutorial/convert-standalone-to-replica-set`
- Convert an existing standalone ``mongod`` instance into a
- three-member replica set.
+:doc:`/tutorial/expand-replica-set`
+ Add a new member to an existing replica set.
- :doc:`/tutorial/expand-replica-set`
- Add a new member to an existing replica set.
+:doc:`/tutorial/remove-replica-set-member`
+ Remove a member from a replica set.
- :doc:`/tutorial/remove-replica-set-member`
- Remove a member from a replica set.
-
- :doc:`/tutorial/replace-replica-set-member`
- Update the replica set configuration when the hostname of a
- member's corresponding ``mongod`` instance has changed.
+:doc:`/tutorial/replace-replica-set-member`
+ Update the replica set configuration when the hostname of a
+ member's corresponding ``mongod`` instance has changed.
.. toctree::
diff --git a/source/administration/replica-set-maintenance.txt b/source/administration/replica-set-maintenance.txt
index 3ce1a0bc812..3472540d7c6 100644
--- a/source/administration/replica-set-maintenance.txt
+++ b/source/administration/replica-set-maintenance.txt
@@ -13,43 +13,41 @@ Replica Set Maintenance Tutorials
The following tutorials provide information in maintaining existing
replica sets.
-.. class:: toc
+:doc:`/tutorial/change-oplog-size`
+ Increase the size of the :term:`oplog` which logs operations. In
+ most cases, the default oplog size is sufficient.
- :doc:`/tutorial/change-oplog-size`
- Increase the size of the :term:`oplog` which logs operations. In
- most cases, the default oplog size is sufficient.
+:doc:`/tutorial/perform-maintence-on-replica-set-members`
+ Perform maintenance on a member of a replica set while minimizing
+ downtime.
- :doc:`/tutorial/perform-maintence-on-replica-set-members`
- Perform maintenance on a member of a replica set while minimizing
- downtime.
+:doc:`/tutorial/force-member-to-be-primary`
+ Force a replica set member to become primary.
- :doc:`/tutorial/force-member-to-be-primary`
- Force a replica set member to become primary.
+:doc:`/tutorial/resync-replica-set-member`
+ Sync the data on a member. Either perform initial sync on a new
+ member or resync the data on an existing member that has fallen
+ too far behind to catch up by way of normal replication.
- :doc:`/tutorial/resync-replica-set-member`
- Sync the data on a member. Either perform initial sync on a new
- member or resync the data on an existing member that has fallen
- too far behind to catch up by way of normal replication.
+:doc:`/tutorial/configure-replica-set-tag-sets`
+ Assign tags to replica set members for use in targeting read and
+ write operations to specific members.
- :doc:`/tutorial/configure-replica-set-tag-sets`
- Assign tags to replica set members for use in targeting read and
- write operations to specific members.
+:doc:`/tutorial/reconfigure-replica-set-with-unavailable-members`
+ Reconfigure a replica set when a majority of replica set members
+ are down or unreachable.
- :doc:`/tutorial/reconfigure-replica-set-with-unavailable-members`
- Reconfigure a replica set when a majority of replica set members
- are down or unreachable.
+:doc:`/tutorial/manage-chained-replication`
+ Disable or enable chained replication. Chained replication occurs
+ when a secondary replicates from another secondary instead of the
+ primary.
- :doc:`/tutorial/manage-chained-replication`
- Disable or enable chained replication. Chained replication occurs
- when a secondary replicates from another secondary instead of the
- primary.
+:doc:`/tutorial/change-hostnames-in-a-replica-set`
+ Update the replica set configuration to reflect changes in
+ members' hostnames.
- :doc:`/tutorial/change-hostnames-in-a-replica-set`
- Update the replica set configuration to reflect changes in
- members' hostnames.
-
- :doc:`/tutorial/configure-replica-set-secondary-sync-target`
- Specify the member that a secondary member synchronizes from.
+: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.
diff --git a/source/administration/replica-set-member-configuration.txt b/source/administration/replica-set-member-configuration.txt
index 7f0302bd398..5d88573b65e 100644
--- a/source/administration/replica-set-member-configuration.txt
+++ b/source/administration/replica-set-member-configuration.txt
@@ -18,30 +18,28 @@ backups, to support reporting, or to act as a cold standby.
.. include:: /includes/warning-mixed-version-rs-config.rst
-.. class:: toc
+:doc:`/tutorial/adjust-replica-set-member-priority`
+ Change the precedence given to a replica set members in an
+ election for primary.
- :doc:`/tutorial/adjust-replica-set-member-priority`
- Change the precedence given to a replica set member in an
- election for primary.
+:doc:`/tutorial/configure-secondary-only-replica-set-member`
+ Make a secondary member ineligible for election as primary.
- :doc:`/tutorial/configure-secondary-only-replica-set-member`
- Make a secondary member ineligible for election as primary.
+:doc:`/tutorial/configure-a-hidden-replica-set-member`
+ Configure a secondary member to be invisible to applications in
+ order to support significantly different usage, such as a
+ dedicated backups.
- :doc:`/tutorial/configure-a-hidden-replica-set-member`
- Configure a secondary member to be invisible to applications in
- order to support significantly different usage, such as a
- dedicated backups.
+:doc:`/tutorial/configure-a-delayed-replica-set-member`
+ Configure a secondary member to keep a delayed copy of the data
+ set in order to provide a rolling backup.
- :doc:`/tutorial/configure-a-delayed-replica-set-member`
- Configure a secondary member to keep a delayed copy of the data
- set in order to provide a rolling backup.
+:doc:`/tutorial/configure-a-non-voting-replica-set-member`
+ Create a secondary member that keeps a copy of the data set but
+ does not vote in an election.
- :doc:`/tutorial/configure-a-non-voting-replica-set-member`
- Create a secondary member that keeps a copy of the data set but
- does not vote in an election.
-
- :doc:`/tutorial/convert-secondary-into-arbiter`
- Convert a secondary to an arbiter.
+:doc:`/tutorial/convert-secondary-into-arbiter`
+ Convert a secondary to an arbiter.
.. toctree::
diff --git a/source/administration/security-checklist.txt b/source/administration/security-checklist.txt
index 8e63a217fbe..814c33a2292 100644
--- a/source/administration/security-checklist.txt
+++ b/source/administration/security-checklist.txt
@@ -18,24 +18,21 @@ Pre-production Checklist/Considerations
|arrow| Enable Access Control and Enforce Authentication
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. list-table::
- :widths: 5 95
-
- * -
-
- - Enable access control and specify the authentication mechanism.
- You can use MongoDB's SCRAM or x.509 authentication mechanism or
- integrate with your existing Kerberos/LDAP infrastructure. Authentication
- requires that all clients and servers provide valid credentials
- before they can connect to the system.
+.. container::
+
+ Enable access control and specify the authentication mechanism.
+ You can use MongoDB's SCRAM or x.509 authentication mechanism or
+ integrate with your existing Kerberos/LDAP infrastructure. Authentication
+ requires that all clients and servers provide valid credentials
+ before they can connect to the system.
- See :doc:`/core/authentication` and
- :doc:`/tutorial/enable-authentication`.
+ See :doc:`/core/authentication` and
+ doc:`/tutorial/enable-authentication`.
.. _security-checklist-role-based-access-control:
-|arrow| Configure Role-Based Access Control
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Configure Role-Based Access Control
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. list-table::
:widths: 5 95
diff --git a/source/administration/sharded-cluster-administration.txt b/source/administration/sharded-cluster-administration.txt
index dd3401f536d..50073749500 100644
--- a/source/administration/sharded-cluster-administration.txt
+++ b/source/administration/sharded-cluster-administration.txt
@@ -27,43 +27,41 @@ Sharded Cluster Administration
/tutorial/convert-replica-set-to-replicated-shard-cluster
/tutorial/convert-shard-standalone-to-shard-replica-set
-.. class:: toc
+:doc:`Config Server Administration `
+ This section contains articles and tutorials related to sharded
+ cluster config server administration
- :doc:`Config Server Administration `
- This section contains articles and tutorials related to sharded
- cluster config server administration
+:doc:`/tutorial/view-sharded-cluster-configuration`
+ View status information about the cluster's databases, shards, and
+ chunks.
- :doc:`/tutorial/view-sharded-cluster-configuration`
- View status information about the cluster's databases, shards, and
- chunks.
+:doc:`/tutorial/restart-sharded-cluster`
+ Stop and restart a sharded cluster.
- :doc:`/tutorial/restart-sharded-cluster`
- Stop and restart a sharded cluster.
+:doc:`/tutorial/migrate-sharded-cluster-to-new-hardware`
+ Migrate a sharded cluster to a different hardware system, for
+ example, when moving a pre-production environment to production.
- :doc:`/tutorial/migrate-sharded-cluster-to-new-hardware`
- Migrate a sharded cluster to a different hardware system, for
- example, when moving a pre-production environment to production.
+:doc:`/tutorial/add-shards-to-shard-cluster`
+ Add a shard to add capacity to a sharded cluster.
- :doc:`/tutorial/add-shards-to-shard-cluster`
- Add a shard to add capacity to a sharded cluster.
+:doc:`/tutorial/remove-shards-from-cluster`
+ Migrate a single shard's data and remove the shard.
- :doc:`/tutorial/remove-shards-from-cluster`
- Migrate a single shard's data and remove the shard.
+:doc:`/tutorial/clear-jumbo-flag`
+ Manually clear ``jumbo`` flag from a chunk.
- :doc:`/tutorial/clear-jumbo-flag`
- Manually clear ``jumbo`` flag from a chunk.
+:doc:`/tutorial/backup-sharded-cluster-metadata`
+ Create a backup of a sharded cluster's metadata while keeping the
+ cluster operational.
- :doc:`/tutorial/backup-sharded-cluster-metadata`
- Create a backup of a sharded cluster's metadata while keeping the
- cluster operational.
+:doc:`/tutorial/convert-sharded-cluster-to-replica-set`
+ Convert a sharded cluster into a single replica set.
- :doc:`/tutorial/convert-sharded-cluster-to-replica-set`
- Convert a sharded cluster into a single replica set.
+:doc:`/tutorial/convert-replica-set-to-replicated-shard-cluster`
+ Convert a replica set to a sharded cluster in which each shard is
+ its own replica set.
- :doc:`/tutorial/convert-replica-set-to-replicated-shard-cluster`
- Convert a replica set to a sharded cluster in which each shard is
- its own replica set.
-
- :doc:`/tutorial/convert-shard-standalone-to-shard-replica-set`
- Convert a shard standalone instance to a shard replica set.
+:doc:`/tutorial/convert-shard-standalone-to-shard-replica-set`
+ Convert a shard standalone instance to a shard replica set.
diff --git a/source/administration/sharded-cluster-config-servers.txt b/source/administration/sharded-cluster-config-servers.txt
index 0553d8715a6..808d8a1e69b 100644
--- a/source/administration/sharded-cluster-config-servers.txt
+++ b/source/administration/sharded-cluster-config-servers.txt
@@ -16,10 +16,10 @@ Sharded Cluster Config Server Administration
/tutorial/replace-config-server
-.. class:: toc
+:doc:`/tutorial/replace-config-server`
+ Replace a config server in a config server replica set.
- :doc:`/tutorial/replace-config-server`
- Replace a config server in a config server replica set.
+.. seealso::
-.. seealso:: :doc:`/administration/backup-sharded-clusters`
+ :doc:`/administration/backup-sharded-clusters`
diff --git a/source/aggregation.txt b/source/aggregation.txt
index 2ce36218a3a..c7df889cc00 100644
--- a/source/aggregation.txt
+++ b/source/aggregation.txt
@@ -29,20 +29,6 @@ MongoDB's :doc:`aggregation framework
processing pipelines. Documents enter a multi-stage pipeline that
transforms the documents into an aggregated result. For example:
-.. only:: website and dirhtml
-
- .. raw:: html
-
-
-
-.. only:: website and html and (not dirhtml)
-
- .. raw:: html
-
-
-
-In the example:
-
.. code-block:: javascript
db.orders.aggregate([
diff --git a/source/appendix/security/appendixA-openssl-ca.txt b/source/appendix/security/appendixA-openssl-ca.txt
index 60d3ab57304..39c65687d35 100644
--- a/source/appendix/security/appendixA-openssl-ca.txt
+++ b/source/appendix/security/appendixA-openssl-ca.txt
@@ -6,11 +6,8 @@ Appendix A - OpenSSL CA Certificate for Testing
.. default-domain:: mongodb
-.. role:: red(strong)
- :class: text-danger
+.. warning:: Disclaimer
-.. admonition:: Disclaimer
- :class: warning
This page is provided for :red:`testing purposes` only and the
certificates are for :red:`testing purposes only`.
diff --git a/source/appendix/security/appendixB-openssl-server.txt b/source/appendix/security/appendixB-openssl-server.txt
index eb0d21f004b..25bf95ba4a0 100644
--- a/source/appendix/security/appendixB-openssl-server.txt
+++ b/source/appendix/security/appendixB-openssl-server.txt
@@ -6,11 +6,10 @@ Appendix B - OpenSSL Server Certificates for Testing
.. default-domain:: mongodb
-.. role:: red(strong)
- :class: text-danger
-.. admonition:: Disclaimer
- :class: warning
+
+.. warning:: Disclaimer
+
This page is provided for :red:`testing purposes` only and the
certificates are for :red:`testing purposes only`.
@@ -173,9 +172,7 @@ B. Generate the Test PEM File for Server
:binary:`~bin.mongod` or a :binary:`~bin.mongos` for TLS/SSL
:red:`testing`. For example:
- **For MongoDB 4.2 or greater**
-
- .. container::
+ .. example:: For MongoDB 4.2 or greater
.. code-block:: javascript
@@ -186,9 +183,7 @@ B. Generate the Test PEM File for Server
:option:`--sslCAFile ` are :ref:`deprecated as
of MongoDB 4.2 <4.2-tls>`.
- **For MongoDB 4.0 and earlier**
-
- .. container::
+ .. example:: For MongoDB 4.0 and earlier
.. code-block:: javascript
diff --git a/source/appendix/security/appendixC-openssl-client.txt b/source/appendix/security/appendixC-openssl-client.txt
index 8cdf91cc072..eaaa48df098 100644
--- a/source/appendix/security/appendixC-openssl-client.txt
+++ b/source/appendix/security/appendixC-openssl-client.txt
@@ -6,11 +6,8 @@ Appendix C - OpenSSL Client Certificates for Testing
.. default-domain:: mongodb
-.. role:: red(strong)
- :class: text-danger
+.. warning:: Disclaimer
-.. admonition:: Disclaimer
- :class: warning
This page is provided for :red:`testing purposes` only and the certificates
are for :red:`testing purposes only`.
@@ -139,18 +136,18 @@ B. Generate the Test PEM File for Client
shell for TLS/SSL :red:`testing`. For example, to connect to a
:binary:`~bin.mongod` or a :binary:`~bin.mongos`:
- **For MongoDB 4.2 or greater**, include the following options for the client:
+ .. example::
- .. container::
+ For MongoDB 4.2 or greater, include the following options for the client:
.. code-block:: javascript
mongo --tls --host --tlsCertificateKeyFile test-client.pem --tlsCAFile test-ca.pem
- **For MongoDB 4.0 and earlier**, include the following options for the client:
-
- .. container::
+ .. example::
+
+ For MongoDB 4.0 and earlier**, include the following options for the client:
.. code-block:: javascript
diff --git a/source/applications/data-models-applications.txt b/source/applications/data-models-applications.txt
index 6f9c5a8a394..c6e61a52e23 100644
--- a/source/applications/data-models-applications.txt
+++ b/source/applications/data-models-applications.txt
@@ -10,30 +10,28 @@ Model Specific Application Contexts
:depth: 1
:class: singlecol
-.. class:: toc
+:doc:`/tutorial/model-data-for-atomic-operations`
+ Illustrates how embedding fields related to an atomic update
+ within the same document ensures that the fields are in sync.
- :doc:`/tutorial/model-data-for-atomic-operations`
- Illustrates how embedding fields related to an atomic update
- within the same document ensures that the fields are in sync.
+:doc:`/tutorial/model-data-for-keyword-search`
+ Describes one method for supporting keyword search by storing
+ keywords in an array in the same document as the text field.
+ Combined with a multi-key index, this pattern can support
+ application's keyword search operations.
- :doc:`/tutorial/model-data-for-keyword-search`
- Describes one method for supporting keyword search by storing
- keywords in an array in the same document as the text field.
- Combined with a multi-key index, this pattern can support
- application's keyword search operations.
+:doc:`/tutorial/model-data-for-schema-versioning`
+ Describes one method for schema iteration without downtime.
- :doc:`/tutorial/model-data-for-schema-versioning`
- Describes one method for schema iteration without downtime.
+:doc:`/tutorial/model-monetary-data`
+ Describes two methods to model monetary data in MongoDB.
- :doc:`/tutorial/model-monetary-data`
- Describes two methods to model monetary data in MongoDB.
+:doc:`/tutorial/model-time-data`
+ Describes how to deal with local time in MongoDB.
- :doc:`/tutorial/model-time-data`
- Describes how to deal with local time in MongoDB.
-
- :doc:`/tutorial/model-computed-data`
- Describes how to derive a value from source data and store that
- value in a database.
+:doc:`/tutorial/model-computed-data`
+ Describes how to derive a value from source data and store that
+ value in a database.
.. toctree::
:titlesonly:
diff --git a/source/applications/data-models-relationships.txt b/source/applications/data-models-relationships.txt
index 2fd32d51875..cbd874eb0ce 100644
--- a/source/applications/data-models-relationships.txt
+++ b/source/applications/data-models-relationships.txt
@@ -10,22 +10,20 @@ Model Relationships Between Documents
:depth: 1
:class: singlecol
-.. class:: toc
-
- :doc:`/tutorial/model-embedded-one-to-one-relationships-between-documents`
- Presents a data model that uses :ref:`embedded documents
- ` to describe one-to-one relationships
- between connected data.
-
- :doc:`/tutorial/model-embedded-one-to-many-relationships-between-documents`
- Presents a data model that uses :ref:`embedded documents
- ` to describe one-to-many relationships
- between connected data.
-
- :doc:`/tutorial/model-referenced-one-to-many-relationships-between-documents`
- Presents a data model that uses :ref:`references
- ` to describe one-to-many relationships
- between documents.
+:doc:`/tutorial/model-embedded-one-to-one-relationships-between-documents`
+ Presents a data model that uses :ref:`embedded documents
+ ` to describe one-to-one relationships
+ between connected data.
+
+:doc:`/tutorial/model-embedded-one-to-many-relationships-between-documents`
+ Presents a data model that uses :ref:`embedded documents
+ ` to describe one-to-many relationships
+ between connected data.
+
+:doc:`/tutorial/model-referenced-one-to-many-relationships-between-documents`
+ Presents a data model that uses :ref:`references
+ ` to describe one-to-many relationships
+ between documents.
.. toctree::
diff --git a/source/applications/data-models-tree-structures.txt b/source/applications/data-models-tree-structures.txt
index 57f540bb1be..f2eb8ccc3d6 100644
--- a/source/applications/data-models-tree-structures.txt
+++ b/source/applications/data-models-tree-structures.txt
@@ -15,33 +15,31 @@ hierarchical or nested data relationships.
.. include:: /images/data-model-tree.rst
-.. class:: toc
-
- :doc:`/tutorial/model-tree-structures-with-parent-references`
- Presents a data model that organizes documents in a tree-like
- structure by storing :ref:`references `
- to "parent" nodes in "child" nodes.
-
- :doc:`/tutorial/model-tree-structures-with-child-references`
- Presents a data model that organizes documents in a tree-like
- structure by storing :ref:`references `
- to "child" nodes in "parent" nodes.
-
- :doc:`/tutorial/model-tree-structures-with-ancestors-array`
- Presents a data model that organizes documents in a tree-like
- structure by storing :ref:`references `
- to "parent" nodes and an array that stores all ancestors.
-
- :doc:`/tutorial/model-tree-structures-with-materialized-paths`
- Presents a data model that organizes documents in a tree-like
- structure by storing full relationship paths between documents. In
- addition to the tree node, each document stores the ``_id`` of the
- nodes ancestors or path as a string.
-
- :doc:`/tutorial/model-tree-structures-with-nested-sets`
- Presents a data model that organizes documents in a tree-like
- structure using the *Nested Sets* pattern. This optimizes
- discovering subtrees at the expense of tree mutability.
+:doc:`/tutorial/model-tree-structures-with-parent-references`
+ Presents a data model that organizes documents in a tree-like
+ structure by storing :ref:`references `
+ to "parent" nodes in "child" nodes.
+
+:doc:`/tutorial/model-tree-structures-with-child-references`
+ Presents a data model that organizes documents in a tree-like
+ structure by storing :ref:`references `
+ to "child" nodes in "parent" nodes.
+
+:doc:`/tutorial/model-tree-structures-with-ancestors-array`
+ Presents a data model that organizes documents in a tree-like
+ structure by storing :ref:`references `
+ to "parent" nodes and an array that stores all ancestors.
+
+:doc:`/tutorial/model-tree-structures-with-materialized-paths`
+ Presents a data model that organizes documents in a tree-like
+ structure by storing full relationship paths between documents. In
+ addition to the tree node, each document stores the ``_id`` of the
+ nodes ancestors or path as a string.
+
+:doc:`/tutorial/model-tree-structures-with-nested-sets`
+ Presents a data model that organizes documents in a tree-like
+ structure using the *Nested Sets* pattern. This optimizes
+ discovering subtrees at the expense of tree mutability.
.. toctree::
diff --git a/source/applications/data-models.txt b/source/applications/data-models.txt
index a2ff16a24b3..1559207ce2c 100644
--- a/source/applications/data-models.txt
+++ b/source/applications/data-models.txt
@@ -13,7 +13,7 @@ Data Model Examples and Patterns
:depth: 1
:class: singlecol
-.. topic:: Building with Patterns Blog Series
+.. seealso:: Building with Patterns Blog Series
For additional patterns and use cases, see also: `Building with
Patterns
@@ -26,56 +26,54 @@ Data Model Examples and Patterns
The following documents provide overviews of various data modeling
patterns and common schema design considerations:
-.. class:: toc
-
- :doc:`/applications/data-models-relationships`
- Examples for modeling relationships between documents.
-
- :doc:`/tutorial/model-embedded-one-to-one-relationships-between-documents`
- Presents a data model that uses :ref:`embedded documents
- ` to describe one-to-one relationships
- between connected data.
-
- :doc:`/tutorial/model-embedded-one-to-many-relationships-between-documents`
- Presents a data model that uses :ref:`embedded documents
- ` to describe one-to-many
- relationships between connected data.
-
- :doc:`/tutorial/model-referenced-one-to-many-relationships-between-documents`
- Presents a data model that uses :ref:`references
- ` to describe one-to-many
- relationships between documents.
-
- :doc:`/applications/data-models-tree-structures`
- Examples for modeling tree structures.
-
- :doc:`/tutorial/model-tree-structures-with-parent-references`
- Presents a data model that organizes documents in a tree-like
- structure by storing :ref:`references
- ` to "parent" nodes in "child"
- nodes.
-
- :doc:`/tutorial/model-tree-structures-with-child-references`
- Presents a data model that organizes documents in a tree-like
- structure by storing :ref:`references
- ` to "child" nodes in "parent"
- nodes.
-
- See :doc:`/applications/data-models-tree-structures` for additional
- examples of data models for tree structures.
-
- :doc:`/applications/data-models-applications`
- Examples for models for specific application contexts.
-
- :doc:`/tutorial/model-data-for-atomic-operations`
- Illustrates how embedding fields related to an atomic update
- within the same document ensures that the fields are in sync.
-
- :doc:`/tutorial/model-data-for-keyword-search`
- Describes one method for supporting keyword search by storing
- keywords in an array in the same document as the text field.
- Combined with a multi-key index, this pattern can support
- application's keyword search operations.
+:doc:`/applications/data-models-relationships`
+ Examples for modeling relationships between documents.
+
+ :doc:`/tutorial/model-embedded-one-to-one-relationships-between-documents`
+ Presents a data model that uses :ref:`embedded documents
+ ` to describe one-to-one relationships
+ between connected data.
+
+ :doc:`/tutorial/model-embedded-one-to-many-relationships-between-documents`
+ Presents a data model that uses :ref:`embedded documents
+ ` to describe one-to-many
+ relationships between connected data.
+
+ :doc:`/tutorial/model-referenced-one-to-many-relationships-between-documents`
+ Presents a data model that uses :ref:`references
+ ` to describe one-to-many
+ relationships between documents.
+
+:doc:`/applications/data-models-tree-structures`
+ Examples for modeling tree structures.
+
+ :doc:`/tutorial/model-tree-structures-with-parent-references`
+ Presents a data model that organizes documents in a tree-like
+ structure by storing :ref:`references
+ ` to "parent" nodes in "child"
+ nodes.
+
+ :doc:`/tutorial/model-tree-structures-with-child-references`
+ Presents a data model that organizes documents in a tree-like
+ structure by storing :ref:`references
+ ` to "child" nodes in "parent"
+ nodes.
+
+ See :doc:`/applications/data-models-tree-structures` for additional
+ examples of data models for tree structures.
+
+:doc:`/applications/data-models-applications`
+ Examples for models for specific application contexts.
+
+ :doc:`/tutorial/model-data-for-atomic-operations`
+ Illustrates how embedding fields related to an atomic update
+ within the same document ensures that the fields are in sync.
+
+ :doc:`/tutorial/model-data-for-keyword-search`
+ Describes one method for supporting keyword search by storing
+ keywords in an array in the same document as the text field.
+ Combined with a multi-key index, this pattern can support
+ application's keyword search operations.
.. toctree::
diff --git a/source/applications/indexes.txt b/source/applications/indexes.txt
index 393fc62fb88..cbefe083b0c 100644
--- a/source/applications/indexes.txt
+++ b/source/applications/indexes.txt
@@ -37,25 +37,23 @@ index, and in addition, MongoDB can use an :doc:`intersection
The following documents introduce indexing strategies:
-.. class:: toc
-
- :doc:`/tutorial/create-indexes-to-support-queries`
- An index supports a query when the index contains all the fields
- scanned by the query. Creating indexes that support queries
- results in greatly increased query performance.
-
- :doc:`/tutorial/sort-results-with-indexes`
- To support efficient queries, use the strategies here when you
- specify the sequential order and sort order of index fields.
-
- :doc:`/tutorial/ensure-indexes-fit-ram`
- When your index fits in RAM, the system can avoid reading the
- index from disk and you get the fastest processing.
-
- :doc:`/tutorial/create-queries-that-ensure-selectivity`
- Selectivity is the ability of a query to narrow results using the
- index. Selectivity allows MongoDB to use the index for a larger
- portion of the work associated with fulfilling the query.
+:doc:`/tutorial/create-indexes-to-support-queries`
+ An index supports a query when the index contains all the fields
+ scanned by the query. Creating indexes that support queries
+ results in greatly increased query performance.
+
+:doc:`/tutorial/sort-results-with-indexes`
+ To support efficient queries, use the strategies here when you
+ specify the sequential order and sort order of index fields.
+
+:doc:`/tutorial/ensure-indexes-fit-ram`
+ When your index fits in RAM, the system can avoid reading the
+ index from disk and you get the fastest processing.
+
+:doc:`/tutorial/create-queries-that-ensure-selectivity`
+ Selectivity is the ability of a query to narrow results using the
+ index. Selectivity allows MongoDB to use the index for a larger
+ portion of the work associated with fulfilling the query.
.. toctree::
diff --git a/source/applications/replication.txt b/source/applications/replication.txt
index c8b256116ca..899e98e7ad1 100644
--- a/source/applications/replication.txt
+++ b/source/applications/replication.txt
@@ -21,18 +21,16 @@ additional read and write configurations for replica sets.
replica sets provide the same operational semantics with regards to
write and read operations.
-.. class:: toc
+:doc:`/core/replica-set-write-concern`
+ Write concern describes the level of acknowledgement requested
+ from MongoDB for write operations.
- :doc:`/core/replica-set-write-concern`
- Write concern describes the level of acknowledgement requested
- from MongoDB for write operations.
+:doc:`/core/read-preference`
+ Read preference specifies where (i.e. which members of the replica
+ set) the drivers should direct the read operations.
- :doc:`/core/read-preference`
- Read preference specifies where (i.e. which members of the replica
- set) the drivers should direct the read operations.
-
- :doc:`/core/read-preference-mechanics`
- Describes the mechanics of read preference.
+:doc:`/core/read-preference-mechanics`
+ Describes the mechanics of read preference.
.. toctree::
diff --git a/source/changeStreams.txt b/source/changeStreams.txt
index d6e8045b847..763c4d0cd1f 100644
--- a/source/changeStreams.txt
+++ b/source/changeStreams.txt
@@ -1,7 +1,4 @@
-.. index:: changeStreams notification
-
.. _changeStreams:
-
.. _collection_watch:
==============
@@ -98,8 +95,7 @@ You can open change streams against:
documentation. See also the :binary:`~bin.mongo` shell method
:method:`Mongo.watch()`.
-.. admonition:: Change Stream Examples
- :class: note
+.. note:: Change Stream Examples
The examples on this page use the MongoDB drivers to illustrate how
to open a change stream cursor for a collection and work with the
@@ -110,192 +106,195 @@ You can open change streams against:
Open A Change Stream
--------------------
+To open a change stream:
+
+- For a replica set, you can issue the open change stream operation
+ from any of the data-bearing members.
+
+- For a sharded cluster, you must issue the open change stream
+ operation from the :binary:`~bin.mongos`.
+
+The following example opens a change stream for a collection and
+iterates over the cursor to retrieve the change stream documents.
+[#start-time]_
+
+.. tabs-selector:: drivers
+
+.. tabs-drivers::
+
+ .. tab::
+ :tabid: python
+
+ The Python examples below assume that you have :api:`connected to a MongoDB replica set and have accessed a database
+ ` that contains an ``inventory`` collection.
+
+ .. literalinclude:: /driver-examples/test_examples.py
+ :language: python
+ :dedent: 12
+ :start-after: Start Changestream Example 1
+ :end-before: End Changestream Example 1
+
+ .. tab::
+ :tabid: motor
+
+ The examples below assume that you have `connected to a MongoDB replica set and have accessed a database
+ `__
+ that contains an ``inventory`` collection.
+
+ .. literalinclude:: /driver-examples/test_examples_motor.py
+ :language: python
+ :dedent: 12
+ :start-after: Start Changestream Example 1
+ :end-before: End Changestream Example 1
+
+ .. tab::
+ :tabid: java-sync
+
+ The Java examples below assume that you have `connected to a MongoDB replica set and have accessed a database
+ `__
+ that contains an ``inventory`` collection.
+
+ .. literalinclude:: /driver-examples/DocumentationSamples.java
+ :language: java
+ :dedent: 8
+ :start-after: Start Changestream Example 1
+ :end-before: End Changestream Example 1
+
+ .. tab::
+ :tabid: csharp
+
+ The C# examples below assume that you have `connected to a MongoDB replica set and have accessed a database
+ `__
+ that contains an ``inventory`` collection.
+
+ .. literalinclude:: /driver-examples/ChangeStreamExamples.cs
+ :language: c#
+ :dedent: 12
+ :start-after: Start Changestream Example 1
+ :end-before: End Changestream Example 1
+
+ .. tab::
+ :tabid: c
+
+ The C examples below assume that you have `connected to a MongoDB replica set and have accessed a database
+ `__
+ that contains an ``inventory`` collection.
+
+ .. literalinclude:: /driver-examples/test-mongoc-sample-commands.c
+ :language: c
+ :dedent: 3
+ :start-after: Start Changestream Example 1
+ :end-before: End Changestream Example 1
+
+ .. tab::
+ :tabid: nodejs
+
+ The Node.js examples below assume that you have `connected to a MongoDB replica set and have accessed a database
+ `__
+ that contains an ``inventory`` collection.
+
+ The following example uses stream to process the change events.
+
+ .. literalinclude:: /driver-examples/node_changestreams.js
+ :language: javascript
+ :dedent: 6
+ :start-after: Start Changestream Example 1
+ :end-before: End Changestream Example 1
+
+ Alternatively, you can also use iterator to process the change events:
+
+ .. literalinclude:: /driver-examples/node_changestreams.js
+ :language: javascript
+ :dedent: 6
+ :start-after: Start Changestream Example 1 Alternative
+ :end-before: End Changestream Example 1 Alternative
+
+ .. tab::
+ :tabid: php
+
+ The examples below assume that you have `connected to a MongoDB replica set and have accessed a database
+ `__
+ that contains an ``inventory`` collection.
+
+ .. literalinclude:: /driver-examples/DocumentationExamplesTest.php
+ :language: php
+ :dedent: 8
+ :start-after: Start Changestream Example 1
+ :end-before: End Changestream Example 1
+
+ .. tab::
+ :tabid: ruby
+
+ The examples below assume that you have `connected to a MongoDB replica set and have accessed a database
+ `__
+ that contains an ``inventory`` collection.
+
+
+ .. literalinclude:: /driver-examples/change_stream_examples_spec.rb
+ :language: ruby
+ :dedent: 8
+ :start-after: Start Changestream Example 1
+ :end-before: End Changestream Example 1
+
+ .. tab::
+ :tabid: go
+
+ The Go examples below assume that you have `connected to a MongoDB replica set and have accessed a database
+ `__
+ that contains an ``inventory`` collection.
+
+ .. literalinclude:: /driver-examples/go_examples.go
+ :language: go
+ :dedent: 2
+ :start-after: Start Changestream Example 1
+ :end-before: End Changestream Example 1
+
+ .. tab::
+ :tabid: swift-sync
+
+ The Swift (Sync) examples below assume that you have
+ `connected to a MongoDB replica set and have accessed a
+ database
+ `__
+ that contains an ``inventory`` collection.
+
+ .. literalinclude:: /driver-examples/swiftSync.swift
+ :language: swift
+ :dedent: 8
+ :start-after: Start Changestream Example 1
+ :end-before: End Changestream Example 1
+
+ .. tab::
+ :tabid: swift-async
+
+ The Swift (Async) examples below assume that you have
+ `connected to a MongoDB replica set and have accessed a
+ database
+ `__
+ that contains an ``inventory`` collection.
-.. container::
-
- .. tabs-pillstrip:: languages
-
- To open a change stream:
-
- - For a replica set, you can issue the open change stream operation
- from any of the data-bearing members.
-
- - For a sharded cluster, you must issue the open change stream
- operation from the :binary:`~bin.mongos`.
-
- The following example opens a change stream for a collection and
- iterates over the cursor to retrieve the change stream documents.
- [#start-time]_
-
- .. tabs-drivers::
-
- tabs:
- - id: python
- content: |
- The Python examples below assume that you have :api:`connected to a MongoDB replica set and have accessed a database
- ` that contains an ``inventory`` collection.
-
- .. literalinclude:: /driver-examples/test_examples.py
- :language: python
- :dedent: 12
- :start-after: Start Changestream Example 1
- :end-before: End Changestream Example 1
-
-
- - id: motor
- content: |
- The examples below assume that you have `connected to a MongoDB replica set and have accessed a database
- `__
- that contains an ``inventory`` collection.
-
- .. literalinclude:: /driver-examples/test_examples_motor.py
- :language: python
- :dedent: 12
- :start-after: Start Changestream Example 1
- :end-before: End Changestream Example 1
-
- - id: java-sync
- content: |
- The Java examples below assume that you have `connected to a MongoDB replica set and have accessed a database
- `__
- that contains an ``inventory`` collection.
-
- .. literalinclude:: /driver-examples/DocumentationSamples.java
- :language: java
- :dedent: 8
- :start-after: Start Changestream Example 1
- :end-before: End Changestream Example 1
-
- - id: csharp
- content: |
- The C# examples below assume that you have `connected to a MongoDB replica set and have accessed a database
- `__
- that contains an ``inventory`` collection.
-
- .. literalinclude:: /driver-examples/ChangeStreamExamples.cs
- :language: c#
- :dedent: 12
- :start-after: Start Changestream Example 1
- :end-before: End Changestream Example 1
-
- - id: c
- content: |
- The C examples below assume that you have `connected to a MongoDB replica set and have accessed a database
- `__
- that contains an ``inventory`` collection.
-
- .. literalinclude:: /driver-examples/test-mongoc-sample-commands.c
- :language: c
- :dedent: 3
- :start-after: Start Changestream Example 1
- :end-before: End Changestream Example 1
-
- - id: nodejs
- content: |
- The Node.js examples below assume that you have `connected to a MongoDB replica set and have accessed a database
- `__
- that contains an ``inventory`` collection.
-
- The following example uses stream to process the change events.
-
- .. literalinclude:: /driver-examples/node_changestreams.js
- :language: javascript
- :dedent: 6
- :start-after: Start Changestream Example 1
- :end-before: End Changestream Example 1
-
- Alternatively, you can also use iterator to process the change events:
-
- .. literalinclude:: /driver-examples/node_changestreams.js
- :language: javascript
- :dedent: 6
- :start-after: Start Changestream Example 1 Alternative
- :end-before: End Changestream Example 1 Alternative
-
- - id: php
- content: |
- The examples below assume that you have `connected to a MongoDB replica set and have accessed a database
- `__
- that contains an ``inventory`` collection.
-
- .. literalinclude:: /driver-examples/DocumentationExamplesTest.php
- :language: php
- :dedent: 8
- :start-after: Start Changestream Example 1
- :end-before: End Changestream Example 1
-
- - id: ruby
- content: |
- The examples below assume that you have `connected to a MongoDB replica set and have accessed a database
- `__
- that contains an ``inventory`` collection.
-
-
- .. literalinclude:: /driver-examples/change_stream_examples_spec.rb
- :language: ruby
- :dedent: 8
- :start-after: Start Changestream Example 1
- :end-before: End Changestream Example 1
-
- - id: go
- content: |
- The Go examples below assume that you have `connected to a MongoDB replica set and have accessed a database
- `__
- that contains an ``inventory`` collection.
-
- .. literalinclude:: /driver-examples/go_examples.go
- :language: go
- :dedent: 2
- :start-after: Start Changestream Example 1
- :end-before: End Changestream Example 1
-
- - id: swift-sync
- content: |
-
- The Swift (Sync) examples below assume that you have
- `connected to a MongoDB replica set and have accessed a
- database
- `__
- that contains an ``inventory`` collection.
-
-
- .. literalinclude:: /driver-examples/swiftSync.swift
- :language: swift
- :dedent: 8
- :start-after: Start Changestream Example 1
- :end-before: End Changestream Example 1
-
- - id: swift-async
- content: |
-
- The Swift (Async) examples below assume that you have
- `connected to a MongoDB replica set and have accessed a
- database
- `__
- that contains an ``inventory`` collection.
-
- .. literalinclude:: /driver-examples/swiftAsync.swift
- :language: swift
- :dedent: 8
- :start-after: Start Changestream Example 1
- :end-before: End Changestream Example 1
-
-
- To retrieve the :ref:`data change event ` from
- the cursor, iterate the change stream cursor. For information on the
- change stream event, see :ref:`change-stream-output`.
-
- While the connection to the MongoDB deployment remains
- open, the cursor remains open until one of the following occurs:
-
- - The cursor is explicitly closed.
-
- - An :ref:`invalidate event ` occurs.
-
- - .. include:: /includes/extracts/changestream-remove-shard.rst
-
- .. note::
- The lifecycle of an unclosed cursor is language-dependent.
+ .. literalinclude:: /driver-examples/swiftAsync.swift
+ :language: swift
+ :dedent: 8
+ :start-after: Start Changestream Example 1
+ :end-before: End Changestream Example 1
+
+To retrieve the :ref:`data change event ` from
+the cursor, iterate the change stream cursor. For information on the
+change stream event, see :ref:`change-stream-output`.
+
+While the connection to the MongoDB deployment remains
+open, the cursor remains open until one of the following occurs:
+
+- The cursor is explicitly closed.
+
+- An :ref:`invalidate event ` occurs.
+
+- .. include:: /includes/extracts/changestream-remove-shard.rst
+
+.. note::
+
+ The lifecycle of an unclosed cursor is language-dependent.
.. [#start-time]
@@ -309,167 +308,166 @@ Open A Change Stream
Modify Change Stream Output
---------------------------
-.. container::
-
- .. tabs-pillstrip:: languages
-
- .. tabs-drivers::
-
- tabs:
- - id: python
- content: |
-
- .. include:: /includes/fact-change-streams-modify-output.rst
+.. tabs-drivers::
- .. literalinclude:: /driver-examples/test_examples.py
- :language: python
- :dedent: 12
- :start-after: Start Changestream Example 4
- :end-before: End Changestream Example 4
+ .. tab::
+ :tabid: python
+ .. include:: /includes/fact-change-streams-modify-output.rst
- - id: motor
- content: |
+ .. literalinclude:: /driver-examples/test_examples.py
+ :language: python
+ :dedent: 12
+ :start-after: Start Changestream Example 4
+ :end-before: End Changestream Example 4
- .. include:: /includes/fact-change-streams-modify-output.rst
- .. literalinclude:: /driver-examples/test_examples_motor.py
- :language: python
- :dedent: 12
- :start-after: Start Changestream Example 4
- :end-before: End Changestream Example 4
+ .. tab::
+ :tabid: motor
- - id: java-sync
- content: |
+ .. include:: /includes/fact-change-streams-modify-output.rst
- .. include:: /includes/fact-change-streams-modify-output.rst
+ .. literalinclude:: /driver-examples/test_examples_motor.py
+ :language: python
+ :dedent: 12
+ :start-after: Start Changestream Example 4
+ :end-before: End Changestream Example 4
- .. code-block:: java
+ .. tab::
+ :tabid: java-sync
- MongoClient mongoClient = new MongoClient( new MongoClientURI("mongodb://host1:port1,host2:port2..."));
+ .. include:: /includes/fact-change-streams-modify-output.rst
- // Select the MongoDB database and collection to open the change stream against
+ .. code-block:: java
- MongoDatabase db = mongoClient.getDatabase("myTargetDatabase");
+ MongoClient mongoClient = new MongoClient( new MongoClientURI("mongodb://host1:port1,host2:port2..."));
- MongoCollection collection = db.getCollection("myTargetCollection");
+ // Select the MongoDB database and collection to open the change stream against
- // Create $match pipeline stage.
- List pipeline = singletonList(Aggregates.match(Filters.or(
- Document.parse("{'fullDocument.username': 'alice'}"),
- Filters.in("operationType", asList("delete")))));
+ MongoDatabase db = mongoClient.getDatabase("myTargetDatabase");
- // Create the change stream cursor, passing the pipeline to the
- // collection.watch() method
+ MongoCollection collection = db.getCollection("myTargetCollection");
- MongoCursor cursor = collection.watch(pipeline).iterator();
+ // Create $match pipeline stage.
+ List pipeline = singletonList(Aggregates.match(Filters.or(
+ Document.parse("{'fullDocument.username': 'alice'}"),
+ Filters.in("operationType", asList("delete")))));
- The ``pipeline`` list includes a single :pipeline:`$match` stage that
- filters any operations where the ``username`` is ``alice``, or
- operations where the ``operationType`` is ``delete``.
+ // Create the change stream cursor, passing the pipeline to the
+ // collection.watch() method
- Passing the ``pipeline`` to the :method:`~db.collection.watch()` method directs the
- change stream to return notifications after passing them through the
- specified ``pipeline``.
+ MongoCursor cursor = collection.watch(pipeline).iterator();
- - id: csharp
- content: |
- .. include:: /includes/fact-change-streams-modify-output.rst
+ The ``pipeline`` list includes a single :pipeline:`$match` stage that
+ filters any operations where the ``username`` is ``alice``, or
+ operations where the ``operationType`` is ``delete``.
- .. literalinclude:: /driver-examples/ChangeStreamExamples.cs
- :language: c#
- :dedent: 16
- :start-after: Start Changestream Example 4
- :end-before: End Changestream Example 4
-
- - id: c
- content: |
- .. include:: /includes/fact-change-streams-modify-output.rst
+ Passing the ``pipeline`` to the :method:`~db.collection.watch()` method directs the
+ change stream to return notifications after passing them through the
+ specified ``pipeline``.
- .. literalinclude:: /driver-examples/test-mongoc-sample-commands.c
- :language: c
- :dedent: 3
- :start-after: Start Changestream Example 4
- :end-before: End Changestream Example 4
+ .. tab::
+ :tabid: csharp
+
+ .. include:: /includes/fact-change-streams-modify-output.rst
- - id: nodejs
- content: |
+ .. literalinclude:: /driver-examples/ChangeStreamExamples.cs
+ :language: c#
+ :dedent: 16
+ :start-after: Start Changestream Example 4
+ :end-before: End Changestream Example 4
+
+ .. tab::
+ :tabid: c
+
+ .. include:: /includes/fact-change-streams-modify-output.rst
- .. include:: /includes/fact-change-streams-modify-output.rst
+ .. literalinclude:: /driver-examples/test-mongoc-sample-commands.c
+ :language: c
+ :dedent: 3
+ :start-after: Start Changestream Example 4
+ :end-before: End Changestream Example 4
- The following example uses stream to process the change events.
+ .. tab::
+ :tabid: nodejs
- .. literalinclude:: /driver-examples/node_changestreams.js
- :language: javascript
- :dedent: 6
- :start-after: Start Changestream Example 4
- :end-before: End Changestream Example 4
+ .. include:: /includes/fact-change-streams-modify-output.rst
- Alternatively, you can also use iterator to process the change events:
+ The following example uses stream to process the change events.
- .. literalinclude:: /driver-examples/node_changestreams.js
- :language: javascript
- :dedent: 6
- :start-after: Start Changestream Example 4 Alternative
- :end-before: End Changestream Example 4 Alternative
+ .. literalinclude:: /driver-examples/node_changestreams.js
+ :language: javascript
+ :dedent: 6
+ :start-after: Start Changestream Example 4
+ :end-before: End Changestream Example 4
+ Alternatively, you can also use iterator to process the change events:
- - id: php
- content: |
- .. include:: /includes/fact-change-streams-modify-output.rst
+ .. literalinclude:: /driver-examples/node_changestreams.js
+ :language: javascript
+ :dedent: 6
+ :start-after: Start Changestream Example 4 Alternative
+ :end-before: End Changestream Example 4 Alternative
- .. literalinclude:: /driver-examples/DocumentationExamplesTest.php
- :language: php
- :dedent: 8
- :start-after: Start Changestream Example 4
- :end-before: End Changestream Example 4
- - id: ruby
- content: |
- .. include:: /includes/fact-change-streams-modify-output.rst
+ .. tab::
+ :tabid: php
+
+ .. include:: /includes/fact-change-streams-modify-output.rst
- - id: go
- content: |
+ .. literalinclude:: /driver-examples/DocumentationExamplesTest.php
+ :language: php
+ :dedent: 8
+ :start-after: Start Changestream Example 4
+ :end-before: End Changestream Example 4
- .. include:: /includes/fact-change-streams-modify-output.rst
+ .. tab::
+ :tabid: ruby
+
+ .. include:: /includes/fact-change-streams-modify-output.rst
- .. literalinclude:: /driver-examples/go_examples.go
- :language: go
- :dedent: 2
- :start-after: Start Changestream Example 4
- :end-before: End Changestream Example 4
+ .. tab::
+ :tabid: go
+
+ .. include:: /includes/fact-change-streams-modify-output.rst
- - id: swift-sync
- content: |
+ .. literalinclude:: /driver-examples/go_examples.go
+ :language: go
+ :dedent: 2
+ :start-after: Start Changestream Example 4
+ :end-before: End Changestream Example 4
- .. include:: /includes/fact-change-streams-modify-output.rst
+ .. tab::
+ :tabid: swift-sync
- .. literalinclude:: /driver-examples/swiftSync.swift
- :language: swift
- :dedent: 8
- :start-after: Start Changestream Example 4
- :end-before: End Changestream Example 4
+ .. include:: /includes/fact-change-streams-modify-output.rst
- - id: swift-async
- content: |
+ .. literalinclude:: /driver-examples/swiftSync.swift
+ :language: swift
+ :dedent: 8
+ :start-after: Start Changestream Example 4
+ :end-before: End Changestream Example 4
- .. include:: /includes/fact-change-streams-modify-output.rst
+ .. tab::
+ :tabid: swift-async
+
+ .. include:: /includes/fact-change-streams-modify-output.rst
- .. literalinclude:: /driver-examples/swiftAsync.swift
- :language: swift
- :dedent: 8
- :start-after: Start Changestream Example 4
- :end-before: End Changestream Example 4
+ .. literalinclude:: /driver-examples/swiftAsync.swift
+ :language: swift
+ :dedent: 8
+ :start-after: Start Changestream Example 4
+ :end-before: End Changestream Example 4
- .. tip::
+.. tip::
- The :ref:`_id ` field of the change stream
- event document act as the :ref:`resume token
- `. Do not use the pipeline to modify or remove
- the change stream event's ``_id`` field.
+ The :ref:`_id ` field of the change stream
+ event document act as the :ref:`resume token
+ `. Do not use the pipeline to modify or remove
+ the change stream event's ``_id`` field.
- .. include:: /includes/extracts/4.2-changes-change-stream-modification-error.rst
+ .. include:: /includes/extracts/4.2-changes-change-stream-modification-error.rst
See :ref:`change-stream-output` for more information on the change stream
@@ -479,220 +477,215 @@ Modify Change Stream Output
Lookup Full Document for Update Operations
------------------------------------------
-.. container::
-
- .. tabs-pillstrip:: languages
-
- By default, change streams only return the delta of fields during
- the update operation. However, you can configure the change stream
- to return the most current majority-committed version of the updated
- document.
-
- .. tabs-drivers::
-
- tabs:
- - id: python
- content: |
-
- To return the most current majority-committed version of the updated
- document, pass ``full_document='updateLookup'`` to the
- :method:`db.collection.watch()` method.
-
- In the example below, all update operations notifications
- include a ``full_document`` field that represents the *current*
- version of the document affected by the update operation.
-
- .. literalinclude:: /driver-examples/test_examples.py
- :language: python
- :dedent: 12
- :start-after: Start Changestream Example 2
- :end-before: End Changestream Example 2
+By default, change streams only return the delta of fields during
+the update operation. However, you can configure the change stream
+to return the most current majority-committed version of the updated
+document.
+.. tabs-drivers::
- - id: motor
- content: |
+ .. tab::
+ :tabid: python
- To return the most current majority-committed version of the updated
- document, pass ``full_document='updateLookup'`` to the
- :method:`db.collection.watch()` method.
+ To return the most current majority-committed version of the updated
+ document, pass ``full_document='updateLookup'`` to the
+ :method:`db.collection.watch()` method.
- In the example below, all update operations notifications
- include a ```full_document`` field that represents the *current*
- version of the document affected by the update operation.
+ In the example below, all update operations notifications
+ include a ``full_document`` field that represents the *current*
+ version of the document affected by the update operation.
- .. literalinclude:: /driver-examples/test_examples_motor.py
- :language: python
- :dedent: 12
- :start-after: Start Changestream Example 2
- :end-before: End Changestream Example 2
+ .. literalinclude:: /driver-examples/test_examples.py
+ :language: python
+ :dedent: 12
+ :start-after: Start Changestream Example 2
+ :end-before: End Changestream Example 2
- - id: java-sync
- content: |
+ .. tab::
+ :tabid: motor
- To return the most current majority-committed version of the updated
- document, pass ``FullDocument.UPDATE_LOOKUP`` to the
- :method:`db.collection.watch.fullDocument()` method.
+ To return the most current majority-committed version of the updated
+ document, pass ``full_document='updateLookup'`` to the
+ :method:`db.collection.watch()` method.
- In the example below, all update operations notifications
- include a ``FullDocument`` field that represents the *current*
- version of the document affected by the update operation.
+ In the example below, all update operations notifications
+ include a ```full_document`` field that represents the *current*
+ version of the document affected by the update operation.
- .. literalinclude:: /driver-examples/DocumentationSamples.java
- :language: java
- :dedent: 8
- :start-after: Start Changestream Example 2
- :end-before: End Changestream Example 2
+ .. literalinclude:: /driver-examples/test_examples_motor.py
+ :language: python
+ :dedent: 12
+ :start-after: Start Changestream Example 2
+ :end-before: End Changestream Example 2
- - id: c
- content: |
+ .. tab::
+ :tabid: java-sync
+
+ To return the most current majority-committed version of the updated
+ document, pass ``FullDocument.UPDATE_LOOKUP`` to the
+ ``db.collection.watch.fullDocument()`` method.
+
+ In the example below, all update operations notifications
+ include a ``FullDocument`` field that represents the *current*
+ version of the document affected by the update operation.
+
+ .. literalinclude:: /driver-examples/DocumentationSamples.java
+ :language: java
+ :dedent: 8
+ :start-after: Start Changestream Example 2
+ :end-before: End Changestream Example 2
- To return the most current majority-committed version of the updated
- document, pass the ``"fullDocument"`` option with the ``"updateLookup"`` value to the
- :method:`mongoc_collection_watch` method.
-
- In the example below, all update operations notifications
- include a ``fullDocument`` field that represents the *current*
- version of the document affected by the update operation.
-
- .. literalinclude:: /driver-examples/test-mongoc-sample-commands.c
- :language: c
- :dedent: 3
- :start-after: Start Changestream Example 2
- :end-before: End Changestream Example 2
-
- - id: csharp
- content: |
-
- To return the most current majority-committed version of the updated
- document, pass ``"FullDocument = ChangeStreamFullDocumentOption.UpdateLookup"`` to the
- :method:`collection.Watch()` method.
-
- In the example below, all update operations notifications
- include a ``FullDocument`` field that represents the *current*
- version of the document affected by the update operation.
-
- .. literalinclude:: /driver-examples/ChangeStreamExamples.cs
- :language: C#
- :dedent: 12
- :start-after: Start Changestream Example 2
- :end-before: End Changestream Example 2
-
-
- - id: nodejs
- content: |
-
- To return the most current majority-committed version of the updated
- document, pass ``{ fullDocument: 'updateLookup' }`` to the
- :method:`collection.watch()` method.
-
- In the example below, all update operations notifications
- include a ``fullDocument`` field that represents the *current*
- version of the document affected by the update operation.
-
- The following example uses stream to process the change events.
-
- .. literalinclude:: /driver-examples/node_changestreams.js
- :language: javascript
- :dedent: 6
- :start-after: Start Changestream Example 2
- :end-before: End Changestream Example 2
-
- Alternatively, you can also use iterator to process the change events:
-
- .. literalinclude:: /driver-examples/node_changestreams.js
- :language: javascript
- :dedent: 6
- :start-after: Start Changestream Example 2 Alternative
- :end-before: End Changestream Example 2 Alternative
-
- - id: php
- content: |
-
- To return the most current
- majority-committed version of the updated document, pass
- ``"fullDocument' => \MongoDB\Operation\ChangeStreamCommand::FULL_DOCUMENT_UPDATE_LOOKUP"``
- to the :method:`watch()` method.
-
- In the example below, all update operations notifications
- include a ``fullDocument`` field that represents the *current*
- version of the document affected by the update operation.
-
- .. literalinclude:: /driver-examples/DocumentationExamplesTest.php
- :language: php
- :dedent: 8
- :start-after: Start Changestream Example 2
- :end-before: End Changestream Example 2
-
- - id: ruby
- content: |
- To return the most current majority-committed version of the updated
- document, pass ``full_document: 'updateLookup'`` to the
- :method:`watch()` method.
-
- In the example below, all update operations notifications
- include a ``full_document`` field that represents the *current*
- version of the document affected by the update operation.
-
- .. literalinclude:: /driver-examples/change_stream_examples_spec.rb
- :language: ruby
- :dedent: 8
- :start-after: Start Changestream Example 2
- :end-before: End Changestream Example 2
-
- - id: go
- content: |
-
- To return the most current majority-committed version of the
- updated document, ``SetFullDocument(options.UpdateLookup)``
- change stream option.
-
- .. literalinclude:: /driver-examples/go_examples.go
- :language: go
- :dedent: 2
- :start-after: Start Changestream Example 2
- :end-before: End Changestream Example 2
-
- - id: swift-sync
- content: |
-
- To return the most current majority-committed version of
- the updated document, pass ``options:
- ChangeStreamOptions(fullDocument: .updateLookup)`` to the
- ``watch()`` method.
-
- .. literalinclude:: /driver-examples/swiftSync.swift
- :language: swift
- :dedent: 8
- :start-after: Start Changestream Example 2
- :end-before: End Changestream Example 2
-
- - id: swift-async
- content: |
-
- To return the most current majority-committed version of
- the updated document, pass ``options:
- ChangeStreamOptions(fullDocument: .updateLookup)`` to the
- ``watch()`` method.
-
- .. literalinclude:: /driver-examples/swiftAsync.swift
- :language: swift
- :dedent: 8
- :start-after: Start Changestream Example 2
- :end-before: End Changestream Example 2
-
- .. note::
-
- If there are one or more majority-committed operations that modified
- the updated document *after* the update operation but *before* the
- lookup, the full document returned may differ significantly from the
- document at the time of the update operation.
-
- However, the deltas included in the change stream document always
- correctly describe the watched collection changes that applied to
- that change stream event.
-
- See :ref:`change-stream-output` for more information on the change
- stream response document format.
+ .. tab::
+ :tabid: c
+
+ To return the most current majority-committed version of the updated
+ document, pass the ``"fullDocument"`` option with the ``"updateLookup"`` value to the
+ ``mongoc_collection_watch`` method.
+
+ In the example below, all update operations notifications
+ include a ``fullDocument`` field that represents the *current*
+ version of the document affected by the update operation.
+
+ .. literalinclude:: /driver-examples/test-mongoc-sample-commands.c
+ :language: c
+ :dedent: 3
+ :start-after: Start Changestream Example 2
+ :end-before: End Changestream Example 2
+
+ .. tab::
+ :tabid: csharp
+
+ To return the most current majority-committed version of the updated
+ document, pass ``"FullDocument = ChangeStreamFullDocumentOption.UpdateLookup"`` to the
+ :method:`db.collection.watch()` method.
+
+ In the example below, all update operations notifications
+ include a ``FullDocument`` field that represents the *current*
+ version of the document affected by the update operation.
+
+ .. literalinclude:: /driver-examples/ChangeStreamExamples.cs
+ :language: C#
+ :dedent: 12
+ :start-after: Start Changestream Example 2
+ :end-before: End Changestream Example 2
+
+
+ .. tab::
+ :tabid: nodejs
+
+ To return the most current majority-committed version of the updated
+ document, pass ``{ fullDocument: 'updateLookup' }`` to the
+ :method:`db.collection.watch()` method.
+
+ In the example below, all update operations notifications
+ include a ``fullDocument`` field that represents the *current*
+ version of the document affected by the update operation.
+
+ The following example uses stream to process the change events.
+
+ .. literalinclude:: /driver-examples/node_changestreams.js
+ :language: javascript
+ :dedent: 6
+ :start-after: Start Changestream Example 2
+ :end-before: End Changestream Example 2
+
+ Alternatively, you can also use iterator to process the change events:
+
+ .. literalinclude:: /driver-examples/node_changestreams.js
+ :language: javascript
+ :dedent: 6
+ :start-after: Start Changestream Example 2 Alternative
+ :end-before: End Changestream Example 2 Alternative
+
+ .. tab::
+ :tabid: php
+
+ To return the most current
+ majority-committed version of the updated document, pass
+ ``"fullDocument' => \MongoDB\Operation\ChangeStreamCommand::FULL_DOCUMENT_UPDATE_LOOKUP"``
+ to the :method:`db.watch()` method.
+
+ In the example below, all update operations notifications
+ include a ``fullDocument`` field that represents the *current*
+ version of the document affected by the update operation.
+
+ .. literalinclude:: /driver-examples/DocumentationExamplesTest.php
+ :language: php
+ :dedent: 8
+ :start-after: Start Changestream Example 2
+ :end-before: End Changestream Example 2
+
+ .. tab::
+ :tabid: ruby
+
+ To return the most current majority-committed version of the updated
+ document, pass ``full_document: 'updateLookup'`` to the
+ :method:`db.watch()` method.
+
+ In the example below, all update operations notifications
+ include a ``full_document`` field that represents the *current*
+ version of the document affected by the update operation.
+
+ .. literalinclude:: /driver-examples/change_stream_examples_spec.rb
+ :language: ruby
+ :dedent: 8
+ :start-after: Start Changestream Example 2
+ :end-before: End Changestream Example 2
+
+ .. tab::
+ :tabid: go
+
+ To return the most current majority-committed version of the
+ updated document, ``SetFullDocument(options.UpdateLookup)``
+ change stream option.
+
+ .. literalinclude:: /driver-examples/go_examples.go
+ :language: go
+ :dedent: 2
+ :start-after: Start Changestream Example 2
+ :end-before: End Changestream Example 2
+
+ .. tab::
+ :tabid: swift-sync
+
+ To return the most current majority-committed version of
+ the updated document, pass ``options:
+ ChangeStreamOptions(fullDocument: .updateLookup)`` to the
+ ``watch()`` method.
+
+ .. literalinclude:: /driver-examples/swiftSync.swift
+ :language: swift
+ :dedent: 8
+ :start-after: Start Changestream Example 2
+ :end-before: End Changestream Example 2
+
+ .. tab::
+ :tabid: swift-async
+
+ To return the most current majority-committed version of
+ the updated document, pass ``options:
+ ChangeStreamOptions(fullDocument: .updateLookup)`` to the
+ ``watch()`` method.
+
+ .. literalinclude:: /driver-examples/swiftAsync.swift
+ :language: swift
+ :dedent: 8
+ :start-after: Start Changestream Example 2
+ :end-before: End Changestream Example 2
+
+.. note::
+
+ If there are one or more majority-committed operations that modified
+ the updated document *after* the update operation but *before* the
+ lookup, the full document returned may differ significantly from the
+ document at the time of the update operation.
+
+ However, the deltas included in the change stream document always
+ correctly describe the watched collection changes that applied to
+ that change stream event.
+
+ See :ref:`change-stream-output` for more information on the change
+ stream response document format.
.. _change-stream-resume:
@@ -708,203 +701,193 @@ Change streams are resumable by specifying a resume token to either
``resumeAfter`` for Change Streams
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. container::
+You can resume a change stream after a specific event by passing a resume token
+to ``resumeAfter`` when opening the cursor. For the resume token, use the
+``_id`` value of the :ref:`change stream event document `.
+See :ref:`change-stream-resume-token` for more information on the resume token.
- .. tabs-pillstrip:: languages
+.. important::
- You can resume a change stream after a specific event by passing a resume token
- to ``resumeAfter`` when opening the cursor. For the resume token, use the
- ``_id`` value of the :ref:`change stream event document `.
- See :ref:`change-stream-resume-token` for more information on the resume token.
+ - The oplog must have enough history to locate the operation
+ associated with the token or the timestamp, if the timestamp is in
+ the past.
- .. important::
+ - .. include:: /includes/extracts/changestream-invalid-events.rst
- - The oplog must have enough history to locate the operation
- associated with the token or the timestamp, if the timestamp is in
- the past.
+.. tabs-drivers::
- - .. include:: /includes/extracts/changestream-invalid-events.rst
+ .. tab::
+ :tabid: python
- .. tabs-drivers::
+ You can use the ``resume_after`` modifier to resume
+ notifications after the operation specified in the resume
+ token. The ``resume_after`` modifier takes a value that must
+ resolve to a resume token, e.g. ``resume_token`` in the
+ example below.
- tabs:
- - id: python
- content: |
- You can use the ``resume_after`` modifier to resume
- notifications after the operation specified in the resume
- token. The ``resume_after`` modifier takes a value that must
- resolve to a resume token, e.g. ``resume_token`` in the
- example below.
+ .. literalinclude:: /driver-examples/test_examples.py
+ :language: python
+ :dedent: 12
+ :start-after: Start Changestream Example 3
+ :end-before: End Changestream Example 3
+ .. tab::
+ :tabid: motor
- .. literalinclude:: /driver-examples/test_examples.py
- :language: python
- :dedent: 12
- :start-after: Start Changestream Example 3
- :end-before: End Changestream Example 3
+ You can use the ``resume_after`` modifier to resume
+ notifications after the operation specified in the resume
+ token. The ``resume_after`` modifier takes a value that must
+ resolve to a resume token, e.g. ``resume_token`` in the
+ example below.
- - id: motor
- content: |
+ .. literalinclude:: /driver-examples/test_examples_motor.py
+ :language: python
+ :dedent: 12
+ :start-after: Start Changestream Example 3
+ :end-before: End Changestream Example 3
- You can use the ``resume_after`` modifier to resume
- notifications after the operation specified in the resume
- token. The ``resume_after`` modifier takes a value that must
- resolve to a resume token, e.g. ``resume_token`` in the
- example below.
+ .. tab::
+ :tabid: java-sync
+
+ You can use the ``resumeAfter()`` method to resume
+ notifications after the operation specified in the resume
+ token. The ``resumeAfter()`` method takes a value that must
+ resolve to a resume token, e.g. ``resumeToken`` in the
+ example below.
+
+ .. literalinclude:: /driver-examples/DocumentationSamples.java
+ :language: java
+ :dedent: 8
+ :start-after: Start Changestream Example 3
+ :end-before: End Changestream Example 3
+
+ .. tab::
+ :tabid: csharp
+
+ In the example below, the ``resumeToken`` is retrieved from the last change stream document
+ and passed to the ``Watch()`` method as an option. Passing the ``resumeToken``
+ to the ``Watch()`` method directs
+ the change stream to attempt to resume notifications starting after the
+ operation specified in the resume token.
- .. literalinclude:: /driver-examples/test_examples_motor.py
- :language: python
- :dedent: 12
- :start-after: Start Changestream Example 3
- :end-before: End Changestream Example 3
- - id: java-sync
- content: |
-
- You can use the ``resumeAfter()`` method to resume
- notifications after the operation specified in the resume
- token. The ``resumeAfter()`` method takes a value that must
- resolve to a resume token, e.g. ``resumeToken`` in the
- example below.
- .. literalinclude:: /driver-examples/DocumentationSamples.java
- :language: java
- :dedent: 8
- :start-after: Start Changestream Example 3
- :end-before: End Changestream Example 3
+ .. literalinclude:: /driver-examples/ChangeStreamExamples.cs
+ :language: C#
+ :dedent: 14
+ :start-after: Start Changestream Example 3
+ :end-before: End Changestream Example 3
- - id: csharp
- content: |
-
- In the example below, the ``resumeToken`` is retrieved from the last change stream document
- and passed to the ``Watch()`` method as an option. Passing the ``resumeToken``
- to the ``Watch()`` method directs
- the change stream to attempt to resume notifications starting after the
- operation specified in the resume token.
-
- .. class:: copyable-code
-
- .. literalinclude:: /driver-examples/ChangeStreamExamples.cs
- :language: C#
- :dedent: 14
- :start-after: Start Changestream Example 3
- :end-before: End Changestream Example 3
-
- - id: c
- content: |
-
- In the example below, the ``resumeAfter`` option is appended to the stream options
- to recreate the stream after it has been destroyed. Passing the ``_id`` to
- the change stream attempts to resume notifications starting after the
- operation specified.
-
- .. class:: copyable-code
-
- .. literalinclude:: /driver-examples/test-mongoc-sample-commands.c
- :language: C
- :dedent: 3
- :start-after: Start Changestream Example 3
- :end-before: End Changestream Example 3
-
-
- - id: nodejs
- content: |
-
- You can use the ``resumeAfter`` option to resume
- notifications after the operation specified in the resume
- token. The ``resumeAfter`` option takes a value that must
- resolve to a resume token, e.g. ``resumeToken`` in the
- example below.
-
- .. literalinclude:: /driver-examples/node_changestreams.js
- :language: javascript
- :dedent: 6
- :start-after: Start Changestream Example 3
- :end-before: End Changestream Example 3
-
- - id: php
- content: |
-
- You can use the ``resumeAfter`` option to resume
- notifications after the operation specified in the resume
- token. The ``resumeAfter`` option takes a value that must
- resolve to a resume token, e.g. ``$resumeToken`` in the
- example below.
-
-
- .. class:: copyable-code
-
- .. literalinclude:: /driver-examples/DocumentationExamplesTest.php
- :language: php
- :dedent: 8
- :start-after: Start Changestream Example 3
- :end-before: End Changestream Example 3
-
- - id: ruby
- content: |
-
- You can use the ``resume_after`` modifier to resume
- notifications after the operation specified in the resume
- token. The ``resume_after`` modifier takes a value that must
- resolve to a resume token, e.g. ``resume_token`` in the
- example below.
-
- .. class:: copyable-code
-
- .. literalinclude:: /driver-examples/change_stream_examples_spec.rb
- :language: ruby
- :dedent: 6
- :start-after: Start Changestream Example 3
- :end-before: End Changestream Example 3
-
- - id: go
- content: |
-
- You can use `ChangeStreamOptions.SetResumeAfter
- `_
- to specify the resume
- token for the change stream. If the resumeAfter option is set,
- the change stream resumes notifications after the operation
- specified in the resume token. The ``SetResumeAfter`` takes a
- value that must resolve to a resume token, e.g.
- ``resumeToken`` in the example below.
-
- .. literalinclude:: /driver-examples/go_examples.go
- :language: go
- :dedent: 2
- :start-after: Start Changestream Example 3
- :end-before: End Changestream Example 3
-
- - id: swift-sync
- content: |
-
- You can use the ``resumeAfter`` option to resume
- notifications after the operation specified in the resume
- token. The ``resumeAfter`` option takes a value that must
- resolve to a resume token, e.g. ``resumeToken`` in the
- example below.
-
- .. literalinclude:: /driver-examples/swiftSync.swift
- :language: swift
- :dedent: 8
- :start-after: Start Changestream Example 3
- :end-before: End Changestream Example 3
-
- - id: swift-async
- content: |
-
- You can use the ``resumeAfter`` option to resume
- notifications after the operation specified in the resume
- token. The ``resumeAfter`` option takes a value that must
- resolve to a resume token, e.g. ``resumeToken`` in the
- example below.
-
- .. literalinclude:: /driver-examples/swiftAsync.swift
- :language: swift
- :dedent: 8
- :start-after: Start Changestream Example 3
- :end-before: End Changestream Example 3
+ .. tab::
+ :tabid: c
+
+ In the example below, the ``resumeAfter`` option is appended to the stream options
+ to recreate the stream after it has been destroyed. Passing the ``_id`` to
+ the change stream attempts to resume notifications starting after the
+ operation specified.
+
+
+
+ .. literalinclude:: /driver-examples/test-mongoc-sample-commands.c
+ :language: C
+ :dedent: 3
+ :start-after: Start Changestream Example 3
+ :end-before: End Changestream Example 3
+
+
+ .. tab::
+ :tabid: nodejs
+
+ You can use the ``resumeAfter`` option to resume
+ notifications after the operation specified in the resume
+ token. The ``resumeAfter`` option takes a value that must
+ resolve to a resume token, e.g. ``resumeToken`` in the
+ example below.
+
+ .. literalinclude:: /driver-examples/node_changestreams.js
+ :language: javascript
+ :dedent: 6
+ :start-after: Start Changestream Example 3
+ :end-before: End Changestream Example 3
+
+ .. tab::
+ :tabid: php
+
+ You can use the ``resumeAfter`` option to resume
+ notifications after the operation specified in the resume
+ token. The ``resumeAfter`` option takes a value that must
+ resolve to a resume token, e.g. ``$resumeToken`` in the
+ example below.
+
+ .. literalinclude:: /driver-examples/DocumentationExamplesTest.php
+ :language: php
+ :dedent: 8
+ :start-after: Start Changestream Example 3
+ :end-before: End Changestream Example 3
+
+ .. tab::
+ :tabid: ruby
+
+ You can use the ``resume_after`` modifier to resume
+ notifications after the operation specified in the resume
+ token. The ``resume_after`` modifier takes a value that must
+ resolve to a resume token, e.g. ``resume_token`` in the
+ example below.
+
+ .. literalinclude:: /driver-examples/change_stream_examples_spec.rb
+ :language: ruby
+ :dedent: 6
+ :start-after: Start Changestream Example 3
+ :end-before: End Changestream Example 3
+
+ .. tab::
+ :tabid: go
+
+ You can use `ChangeStreamOptions.SetResumeAfter
+ `_
+ to specify the resume
+ token for the change stream. If the resumeAfter option is set,
+ the change stream resumes notifications after the operation
+ specified in the resume token. The ``SetResumeAfter`` takes a
+ value that must resolve to a resume token, e.g.
+ ``resumeToken`` in the example below.
+
+ .. literalinclude:: /driver-examples/go_examples.go
+ :language: go
+ :dedent: 2
+ :start-after: Start Changestream Example 3
+ :end-before: End Changestream Example 3
+
+ .. tab::
+ :tabid: swift-sync
+
+ You can use the ``resumeAfter`` option to resume
+ notifications after the operation specified in the resume
+ token. The ``resumeAfter`` option takes a value that must
+ resolve to a resume token, e.g. ``resumeToken`` in the
+ example below.
+
+ .. literalinclude:: /driver-examples/swiftSync.swift
+ :language: swift
+ :dedent: 8
+ :start-after: Start Changestream Example 3
+ :end-before: End Changestream Example 3
+
+ .. tab::
+ :tabid: swift-async
+
+ You can use the ``resumeAfter`` option to resume
+ notifications after the operation specified in the resume
+ token. The ``resumeAfter`` option takes a value that must
+ resolve to a resume token, e.g. ``resumeToken`` in the
+ example below.
+
+ .. literalinclude:: /driver-examples/swiftAsync.swift
+ :language: swift
+ :dedent: 8
+ :start-after: Start Changestream Example 3
+ :end-before: End Changestream Example 3
.. _change-stream-start-after:
diff --git a/source/core/aggregation-pipeline-optimization.txt b/source/core/aggregation-pipeline-optimization.txt
index a497c052c69..38a718e9d03 100644
--- a/source/core/aggregation-pipeline-optimization.txt
+++ b/source/core/aggregation-pipeline-optimization.txt
@@ -255,7 +255,7 @@ and MongoDB only needs to store ``n`` items in memory
[#coalescence-allowDiskUse]_. See :ref:`sort-and-memory` for more
information.
-.. admonition:: Sequence Optimization with $skip
+.. note:: Sequence Optimization with $skip
If there is a :pipeline:`$skip` stage between the :pipeline:`$sort`
and :pipeline:`$limit` stages, MongoDB will coalesce the
@@ -418,6 +418,8 @@ transforms the sequence to the following:
MongoDB increases the :pipeline:`$limit` amount with the reordering.
-.. seealso::
+.. seealso::
+
+
:method:`explain ` option in the
:method:`db.collection.aggregate()`
diff --git a/source/core/aggregation-pipeline.txt b/source/core/aggregation-pipeline.txt
index db872563f96..18a6de5380d 100644
--- a/source/core/aggregation-pipeline.txt
+++ b/source/core/aggregation-pipeline.txt
@@ -17,20 +17,6 @@ on the concept of data processing pipelines. Documents enter a
multi-stage pipeline that transforms the documents into aggregated
results. For example:
-.. only:: website and dirhtml
-
- .. raw:: html
-
-
-
-.. only:: website and html and (not dirhtml)
-
- .. raw:: html
-
-
-
-In the example:
-
.. code-block:: javascript
db.orders.aggregate([
@@ -76,7 +62,9 @@ updates in:
.. include:: /includes/table-update-with-aggregation-availability.rst
-.. seealso:: :doc:`/tutorial/update-documents-with-aggregation-pipeline`
+.. seealso::
+
+ :doc:`/tutorial/update-documents-with-aggregation-pipeline`
.. _aggregation-pipeline-expressions:
diff --git a/source/core/backups.txt b/source/core/backups.txt
index 0e28da957f4..143430147dd 100644
--- a/source/core/backups.txt
+++ b/source/core/backups.txt
@@ -4,8 +4,7 @@ MongoDB Backup Methods
.. default-domain:: mongodb
-.. role:: red(strong)
- :class: text-danger
+
.. contents:: On this page
:local:
diff --git a/source/core/bulk-write-operations.txt b/source/core/bulk-write-operations.txt
index 463bef649f2..21600252262 100644
--- a/source/core/bulk-write-operations.txt
+++ b/source/core/bulk-write-operations.txt
@@ -212,7 +212,9 @@ consider the following modifications to your application:
// now we may insert o into a sharded collection
}
-.. seealso:: :ref:`sharding-shard-key` for information
+.. seealso::
+
+ :ref:`sharding-shard-key` for information
on choosing a sharded key. Also see :ref:`Shard Key
Internals ` (in particular,
:ref:`sharding-internals-operations-and-reliability`).
diff --git a/source/core/causal-consistency-read-write-concerns.txt b/source/core/causal-consistency-read-write-concerns.txt
index e7ce2c2d2b3..1019dfa025c 100644
--- a/source/core/causal-consistency-read-write-concerns.txt
+++ b/source/core/causal-consistency-read-write-concerns.txt
@@ -89,8 +89,7 @@ five member replica set:
:alt: Network partition: new primary elected on one side but old primary has not stepped down yet.
:figwidth: 240px
-.. admonition:: With the above partition
- :class: admonition-example
+.. example:: With the above partition
- Writes with :writeconcern:`"majority"` write concern can complete
on ``P``\ :sub:`new` but cannot complete on ``P``\ :sub:`old`.
diff --git a/source/core/crud.txt b/source/core/crud.txt
index aec23d11af9..5cf81e640b7 100644
--- a/source/core/crud.txt
+++ b/source/core/crud.txt
@@ -28,18 +28,18 @@ Query Plan, Performance, and Analysis
Miscellaneous
- :doc:`/core/tailable-cursors`
-.. seealso:: :doc:`/core/transactions`
+.. seealso::
-.. class:: hidden
+ :doc:`/core/transactions`
- .. toctree::
- :titlesonly:
+.. toctree::
+ :titlesonly:
- /core/write-operations-atomicity
- /core/read-isolation-consistency-recency
- /core/distributed-queries
- /tutorial/perform-findAndModify-linearizable-reads
- /core/query-plans
- /core/query-optimization
- /tutorial/analyze-query-plan
- /core/tailable-cursors
+ /core/write-operations-atomicity
+ /core/read-isolation-consistency-recency
+ /core/distributed-queries
+ /tutorial/perform-findAndModify-linearizable-reads
+ /core/query-plans
+ /core/query-optimization
+ /tutorial/analyze-query-plan
+ /core/tailable-cursors
diff --git a/source/core/data-modeling-introduction.txt b/source/core/data-modeling-introduction.txt
index 228a76b8952..b3377c7b921 100644
--- a/source/core/data-modeling-introduction.txt
+++ b/source/core/data-modeling-introduction.txt
@@ -102,7 +102,9 @@ Multi-Document Transactions
.. include:: /includes/extracts/transactions-intro.rst
-.. seealso:: :ref:`Atomicity Considerations `
+.. seealso::
+
+ :ref:`Atomicity Considerations `
Data Use and Performance
------------------------
diff --git a/source/core/data-models.txt b/source/core/data-models.txt
index 13df73d6e02..f1962cd253c 100644
--- a/source/core/data-models.txt
+++ b/source/core/data-models.txt
@@ -12,16 +12,14 @@ Data Modeling Concepts
Consider the following aspects of data modeling in MongoDB:
-.. class:: toc
-
- :doc:`/core/data-model-design`
- Presents the different strategies that you can choose from when
- determining your data model, their strengths and their weaknesses.
-
- :doc:`/core/data-model-operations`
- Details features you should keep in mind when designing your data
- model, such as lifecycle management, indexing, horizontal
- scalability, and document growth.
+:doc:`/core/data-model-design`
+ Presents the different strategies that you can choose from when
+ determining your data model, their strengths and their weaknesses.
+
+:doc:`/core/data-model-operations`
+ Details features you should keep in mind when designing your data
+ model, such as lifecycle management, indexing, horizontal
+ scalability, and document growth.
For a general introduction to data modeling in MongoDB, see the
diff --git a/source/core/distributed-queries.txt b/source/core/distributed-queries.txt
index 7d5921113ea..b4917eae2c6 100644
--- a/source/core/distributed-queries.txt
+++ b/source/core/distributed-queries.txt
@@ -1,4 +1,4 @@
-.. index:: read operation; architecture
+
.. _read-operations-architecture:
===================
@@ -58,7 +58,7 @@ In :term:`replica sets `, all write operations go to the
set's :term:`primary`. The primary applies the write operation and
records the operations on the primary's operation log or :term:`oplog`.
The oplog is a reproducible sequence of operations to the data set.
-:term:`Secondary` members of the set continuously replicate the oplog
+:term:`secondary` members of the set continuously replicate the oplog
and apply the operations to themselves in an asynchronous process.
.. include:: /images/replica-set-read-write-operations-primary.rst
@@ -158,8 +158,10 @@ of the sharded cluster.
For more information, see :doc:`/sharding` and
:doc:`/core/bulk-write-operations`.
-.. seealso:: :ref:`retryable-writes`
+.. seealso::
+
+ :ref:`retryable-writes`
+
+
-.. index:: read operation; connection pooling
-.. index:: connection pooling; read operations
.. _read-operations-connection-pooling:
diff --git a/source/core/document.txt b/source/core/document.txt
index a20684e5c86..fcd85349021 100644
--- a/source/core/document.txt
+++ b/source/core/document.txt
@@ -82,11 +82,11 @@ names:
.. include:: /includes/fact-document-field-name-restrictions.rst
BSON documents may have more than one field with the same name.
-Most :ecosystem:`MongoDB interfaces `, however, represent MongoDB
+Most :driver:`MongoDB interfaces >`, however, represent MongoDB
with a structure (e.g. a hash table) that does not support duplicate
field names. If you need to manipulate documents that have more than one
-field with the same name, see the :ecosystem:`driver documentation
-` for your driver.
+field with the same name, see the :driver:`driver documentation
+>` for your driver.
Some documents created by internal MongoDB processes may have duplicate
fields, but *no* MongoDB process will *ever* add duplicate fields to an
@@ -143,7 +143,7 @@ For examples querying arrays, see:
- :update:`$[]` all positional operator for update operations,
- - :update:`$[/]` filtered positional operator for update operations,
+ - :update:`$[\]` filtered positional operator for update operations,
- :update:`$` positional operator for update operations,
diff --git a/source/core/geohaystack.txt b/source/core/geohaystack.txt
index 820fdd177c1..4be2a98102a 100644
--- a/source/core/geohaystack.txt
+++ b/source/core/geohaystack.txt
@@ -12,8 +12,8 @@
:depth: 1
:class: singlecol
-.. admonition:: Deprecation
- :class: important
+.. important:: Deprecation
+
.. include:: /includes/extracts/4.4-changes-geo-deprecation.rst
diff --git a/source/core/gridfs.txt b/source/core/gridfs.txt
index 68c0d15134f..7020dbe2da6 100644
--- a/source/core/gridfs.txt
+++ b/source/core/gridfs.txt
@@ -1,4 +1,4 @@
-.. index:: GridFS
+
======
GridFS
@@ -81,10 +81,10 @@ remove previous versions if needed.
Furthermore, if your files are all smaller than the 16 MB :limit:`BSON
Document Size` limit, consider storing each file in a single document instead
of using GridFS. You may use the BinData data type to store the binary data.
-See your :ecosystem:`drivers ` documentation for details on
+See your :driver:`drivers >` documentation for details on
using BinData.
-.. index:: GridFS; initialize
+
.. _gridfs-use:
Use GridFS
@@ -93,7 +93,7 @@ Use GridFS
To store and retrieve files using :term:`GridFS`, use either of the
following:
-- A MongoDB driver. See the :ecosystem:`drivers`
+- A MongoDB driver. See the :driver:`drivers>`
documentation for information on using GridFS with your driver.
- The :binary:`~bin.mongofiles` command-line tool. See the
@@ -124,7 +124,7 @@ buckets in a single database. The full collection name, which includes
the bucket name, is subject to the :limit:`namespace length limit
`.
-.. index:: GridFS; chunks collection
+
.. _gridfs-chunks-collection:
The ``chunks`` Collection
@@ -163,7 +163,7 @@ A document from the ``chunks`` collection contains the following fields:
The chunk's payload as a :term:`BSON` ``Binary`` type.
-.. index:: GridFS; files collection
+
.. _gridfs-files-collection:
The ``files`` Collection
@@ -254,15 +254,16 @@ following fields:
additional arbitrary fields to documents in the ``files``
collection, add them to an object in the metadata field.
-.. index:: GridFS; index; indexes
+
.. _gridfs-indexes:
GridFS Indexes
--------------
GridFS uses indexes on each of the ``chunks`` and ``files`` collections
-for efficiency. :ecosystem:`Drivers ` that conform to
-the `GridFS specification`_ automatically create these indexes for
+for efficiency. :driver:`Drivers >` that conform to
+the :spec:`GridFS specification `
+automatically create these indexes for
convenience. You can also create any additional indexes as desired to
suit your application's needs.
@@ -280,7 +281,7 @@ chunks, as demonstrated in the following example:
db.fs.chunks.find( { files_id: myFileID } ).sort( { n: 1 } )
-:ecosystem:`Drivers ` that conform to the `GridFS
+:driver:`Drivers >` that conform to the `GridFS
specification`_ will automatically ensure that this index exists before
read and write operations. See the relevant driver documentation for the
specific behavior of your GridFS application.
@@ -305,8 +306,8 @@ efficient retrieval of files, as shown in this example:
db.fs.files.find( { filename: myFileName } ).sort( { uploadDate: 1 } )
-:ecosystem:`Drivers ` that conform to the `GridFS
-specification`_ will automatically ensure that this index exists before
+:driver:`Drivers >` that conform to the :spec:`GridFS
+specification ` will automatically ensure that this index exists before
read and write operations. See the relevant driver documentation for the
specific behavior of your GridFS application.
@@ -321,12 +322,10 @@ create it using the :binary:`~bin.mongo` shell:
of GridFS is not related to the use of the term *chunks* in
the context of sharding.
-.. _`GridFS specification`: https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.rst
-
Sharding GridFS
---------------
-There are two collections to consider with :term:`gridfs` - ``files`` and
+There are two collections to consider with :term:`GridFS` - ``files`` and
``chunks``.
``chunks`` Collection
@@ -334,7 +333,7 @@ There are two collections to consider with :term:`gridfs` - ``files`` and
To shard the ``chunks`` collection, use either ``{ files_id : 1, n : 1
}`` or ``{ files_id : 1 }`` as the shard key index. ``files_id`` is an
-:term:`objectid` and changes :ref:`monotonically`.
+:term:`ObjectId` and changes :ref:`monotonically`.
For MongoDB drivers that do not run :dbcommand:`filemd5` to verify
successful upload (for example, MongoDB drivers that support MongoDB
diff --git a/source/core/hashed-sharding.txt b/source/core/hashed-sharding.txt
index fbd971e98ef..2f034c6cfd4 100644
--- a/source/core/hashed-sharding.txt
+++ b/source/core/hashed-sharding.txt
@@ -65,7 +65,7 @@ The field you choose as your hashed shard key should have a good
Hashed keys are ideal for shard keys with fields that change
:ref:`monotonically` like :term:`ObjectId` values or
timestamps. A good example of this is the default ``_id`` field, assuming
-it only contains :term:`ObjectID` values.
+it only contains :term:`ObjectId` values.
To shard a collection using a hashed shard key, see
:ref:`deploy-hashed-sharded-cluster-shard-collection`.
diff --git a/source/core/index-compound.txt b/source/core/index-compound.txt
index edece6bce02..669b9c84a28 100644
--- a/source/core/index-compound.txt
+++ b/source/core/index-compound.txt
@@ -1,5 +1,5 @@
-.. index:: index; compound
-.. index:: compound index
+
+
.. _index-type-compound:
================
@@ -95,7 +95,7 @@ as well as both ``item`` and ``stock`` fields:
For details, see :ref:`compound-index-prefix`.
-.. index:: index; sort order
+
.. _index-ascending-and-descending:
Sort Order
diff --git a/source/core/index-creation.txt b/source/core/index-creation.txt
index 3dd92aea1e9..2306ea65440 100644
--- a/source/core/index-creation.txt
+++ b/source/core/index-creation.txt
@@ -1,4 +1,4 @@
-.. index:: index; options
+
.. _index-operations:
.. _index-creation-background:
@@ -123,7 +123,9 @@ To mitigate the risk of this occurrence, before creating the index:
- Stop all writes to the collection from applications that cannot
guarantee violation-free write operations.
-.. seealso:: :ref:`index-creation-index-consistency`
+.. seealso::
+
+ :ref:`index-creation-index-consistency`
Index Build Impact on Database Performance
------------------------------------------
@@ -574,7 +576,9 @@ process:
- The :binary:`~bin.mongod` releases the ``X`` lock on the
collection.
-.. seealso:: :doc:`/faq/concurrency`
+.. seealso::
+
+ :doc:`/faq/concurrency`
.. toctree::
:titlesonly:
diff --git a/source/core/index-hashed.txt b/source/core/index-hashed.txt
index 945dffb6329..35ad8c251cd 100644
--- a/source/core/index-hashed.txt
+++ b/source/core/index-hashed.txt
@@ -1,4 +1,4 @@
-.. index:: index; hashed
+
.. _index-type-hashed:
.. _index-hashed-index:
@@ -74,7 +74,9 @@ the index:
Compound hashed indexes require :ref:`featureCompatibilityVersion
` set to ``4.4``.
-.. seealso:: :ref:`sharding-hashed-sharding`
+.. seealso::
+
+ :ref:`sharding-hashed-sharding`
Considerations
--------------
diff --git a/source/core/index-hidden.txt b/source/core/index-hidden.txt
index cb084ceae21..e13ec685b01 100644
--- a/source/core/index-hidden.txt
+++ b/source/core/index-hidden.txt
@@ -1,4 +1,4 @@
-.. index:: index; hidden
+
.. _index-type-hidden:
===============
diff --git a/source/core/index-intersection.txt b/source/core/index-intersection.txt
index 4b2e9e9091b..ef3c5d570f4 100644
--- a/source/core/index-intersection.txt
+++ b/source/core/index-intersection.txt
@@ -131,7 +131,9 @@ The choice between creating compound indexes that support your queries
or relying on index intersection depends on the specifics of your
system.
-.. seealso:: :doc:`compound indexes `,
+.. seealso::
+
+ :doc:`compound indexes `,
:ref:`compound-key-indexes`
.. _index-intersection-sort:
diff --git a/source/core/index-multikey.txt b/source/core/index-multikey.txt
index 37e21debc21..4f2c9a2afd2 100644
--- a/source/core/index-multikey.txt
+++ b/source/core/index-multikey.txt
@@ -1,4 +1,4 @@
-.. index:: index; multikey
+
.. _index-type-multi-key:
.. _index-type-multikey:
diff --git a/source/core/index-partial.txt b/source/core/index-partial.txt
index 9f24fb70460..5805f64981a 100644
--- a/source/core/index-partial.txt
+++ b/source/core/index-partial.txt
@@ -1,4 +1,4 @@
-.. index:: index; partial
+
.. _index-type-partial:
===============
diff --git a/source/core/index-properties.txt b/source/core/index-properties.txt
index 3ffb2b7e61a..86ec3c88210 100644
--- a/source/core/index-properties.txt
+++ b/source/core/index-properties.txt
@@ -15,30 +15,28 @@ MongoDB supports, indexes can also have various properties. The
following documents detail the index properties that you can select
when building an index.
-.. class:: toc
+:doc:`/core/index-ttl`
+ The TTL index is used for TTL collections, which expire data after
+ a period of time.
- :doc:`/core/index-ttl`
- The TTL index is used for TTL collections, which expire data after
- a period of time.
+:doc:`/core/index-unique`
+ A unique index causes MongoDB to reject all documents that contain
+ a duplicate value for the indexed field.
- :doc:`/core/index-unique`
- A unique index causes MongoDB to reject all documents that contain
- a duplicate value for the indexed field.
+:doc:`/core/index-partial`
+ A partial index indexes only documents that meet specified filter
+ criteria.
- :doc:`/core/index-partial`
- A partial index indexes only documents that meet specified filter
- criteria.
+:doc:`/core/index-case-insensitive`
+ A case insensitive index disregards the case of the index key
+ values.
- :doc:`/core/index-case-insensitive`
- A case insensitive index disregards the case of the index key
- values.
+:doc:`/core/index-hidden`
+ A hidden index is not visible to the query planner.
- :doc:`/core/index-hidden`
- A hidden index is not visible to the query planner.
-
- :doc:`/core/index-sparse`
- A sparse index does not index documents that do not have the
- indexed field.
+:doc:`/core/index-sparse`
+ A sparse index does not index documents that do not have the
+ indexed field.
.. toctree::
diff --git a/source/core/index-single.txt b/source/core/index-single.txt
index 16c18a7b946..929865d9082 100644
--- a/source/core/index-single.txt
+++ b/source/core/index-single.txt
@@ -51,7 +51,7 @@ The created index will support queries that select on the field
db.records.find( { score: 2 } )
db.records.find( { score: { $gt: 10 } } )
-.. index:: index; embedded fields
+
.. _index-embedded-fields:
.. _index-subdocuments:
.. _index-embedded-documents:
diff --git a/source/core/index-sparse.txt b/source/core/index-sparse.txt
index eb95cf2343a..6b9fc288799 100644
--- a/source/core/index-sparse.txt
+++ b/source/core/index-sparse.txt
@@ -1,4 +1,4 @@
-.. index:: index; sparse
+
.. _index-type-sparse:
==============
@@ -184,7 +184,7 @@ complete results:
{ "_id" : ObjectId("523b6e32fb408eea0eec2647"), "userid" : "newbie" }
To use the sparse index, explicitly specify the index with
-:method:`~db.cursor.hint()`:
+:method:`~cursor.hint()`:
.. code-block:: javascript
@@ -198,7 +198,10 @@ the ``score`` field:
{ "_id" : ObjectId("523b6e6ffb408eea0eec2649"), "userid" : "nina", "score" : 90 }
{ "_id" : ObjectId("523b6e61fb408eea0eec2648"), "userid" : "abby", "score" : 82 }
-.. seealso:: :method:`~cursor.explain()` and :doc:`/tutorial/analyze-query-plan`
+.. seealso::
+
+ :method:`~cursor.explain()` and :doc:`/tutorial/analyze-query-plan`
+
Sparse Index with Unique Constraint
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/source/core/index-text.txt b/source/core/index-text.txt
index b67489a437c..11068016076 100644
--- a/source/core/index-text.txt
+++ b/source/core/index-text.txt
@@ -159,19 +159,10 @@ and for Turkish languages, the special ``T`` case foldings as specified
in `Unicode 8.0 Character Database Case Folding
`_.
-.. only:: (not latex)
-
- The case foldings expands the case insensitivity of the ``text``
- index to include characters with diacritics, such as ``é`` and
- ``É``, and characters from non-Latin alphabets, such as "И" and "и"
- in the Cyrillic alphabet.
-
-.. only:: latex
-
- The case foldings expands the case insensitivity of the ``text``
- index to include characters with diacritics, such as ``é`` and
- ``É``, and characters from non-Latin alphabets, such as characters
- from Cyrillic alphabet.
+The case foldings expands the case insensitivity of the ``text``
+index to include characters with diacritics, such as ``é`` and
+``É``, and characters from non-Latin alphabets, such as "И" and "и"
+in the Cyrillic alphabet.
Version 3 of the ``text`` index is also :ref:`diacritic insensitive
`. As such, the index also does not
diff --git a/source/core/index-ttl.txt b/source/core/index-ttl.txt
index 39ef6c1a8a4..b2468aeacf8 100644
--- a/source/core/index-ttl.txt
+++ b/source/core/index-ttl.txt
@@ -1,5 +1,5 @@
-.. index:: index; TTL index
-.. index:: TTL index
+
+
.. _index-feature-ttl:
===========
@@ -57,7 +57,7 @@ If the field is an array, and there are multiple date values in the
index, MongoDB uses *lowest* (i.e. earliest) date value in the array to
calculate the expiration threshold.
-If the indexed field in a document is not a :term:`date `
+If the indexed field in a document is not a :term:`date `
or an array that holds a date value(s), the document will not expire.
If a document does not contain the indexed field, the document will not
@@ -87,7 +87,7 @@ Replica Sets
On :term:`replica set ` members, the TTL background thread *only*
deletes documents when a member is in state :term:`primary`. The TTL background
-thread is idle when a member is in state :term:`secondary`. :term:`Secondary` members replicate
+thread is idle when a member is in state :term:`secondary`. :term:`Secondary ` members replicate
deletion operations from the primary.
Support for Queries
diff --git a/source/core/index-unique.txt b/source/core/index-unique.txt
index 5e43bf152dd..2d5054bc071 100644
--- a/source/core/index-unique.txt
+++ b/source/core/index-unique.txt
@@ -1,4 +1,4 @@
-.. index:: index; unique
+
.. _index-type-unique:
==============
@@ -18,8 +18,8 @@ values; i.e. enforces uniqueness for the indexed fields. By default,
MongoDB creates a unique index on the :ref:`_id `
field during the creation of a collection.
-.. admonition:: New Internal Format
- :class: note
+.. note:: New Internal Format
+
Starting in MongoDB 4.2, for :ref:`featureCompatibilityVersion
` (fCV) of 4.2 (or greater), MongoDB uses a new internal
@@ -39,7 +39,7 @@ method with the ``unique`` option set to ``true``.
db.collection.createIndex( , { unique: true } )
-.. index:: index; unique
+
.. _index-unique-index:
Unique Index on a Single Field
@@ -96,7 +96,9 @@ the collection since the index enforces uniqueness for the
db.collection.insert( { _id: 2, a: [ { loc: "A" }, { qty: 5 } ] } )
db.collection.insert( { _id: 3, a: [ { loc: "A", qty: 10 } ] } )
-.. seealso:: :ref:`unique-separate-documents` and :ref:`unique-index-and-missing-field`
+.. seealso::
+
+ :ref:`unique-separate-documents` and :ref:`unique-index-and-missing-field`
Behavior
--------
@@ -214,7 +216,9 @@ the unique constraint on the value of the field ``x``:
}
})
-.. seealso:: :ref:`unique-partial-indexes`
+.. seealso::
+
+ :ref:`unique-partial-indexes`
.. _unique-partial-indexes:
@@ -253,8 +257,8 @@ For a ranged sharded collection, only the following indexes can be
enforces the uniqueness constraint per shard **if** the ``_id`` field
is **not** the shard key or the prefix of the shard key.
- .. admonition:: Uniqueness and the ``_id`` Index
- :class: important
+ .. important:: Uniqueness and the ``_id`` Index
+
If the ``_id`` field is not the shard key or the prefix of the
shard key, ``_id`` index only enforces the uniqueness constraint
diff --git a/source/core/index-wildcard.txt b/source/core/index-wildcard.txt
index 1c78e919c12..f5fa59d4e1f 100644
--- a/source/core/index-wildcard.txt
+++ b/source/core/index-wildcard.txt
@@ -379,7 +379,9 @@ can still support queries that include explicit array indices. See
:ref:`wildcard-query-support-explicit-array-indices` for more
information.
-.. seealso:: :limit:`Nested Depth for BSON Documents`
+.. seealso::
+
+ :limit:`Nested Depth for BSON Documents`
Restrictions
------------
@@ -482,7 +484,7 @@ MongoDB can use a wildcard index for satisfying the
- The query planner selects the wildcard index for satisfying the
query predicate.
-- The :method:`~cusor.sort()` specifies **only** the query predicate
+- The :method:`~cursor.sort()` specifies **only** the query predicate
field.
- The specified field is never an array.
@@ -578,7 +580,9 @@ MongoDB may select the wildcard index to answer the query:
- ``"parentObject.nestedArray" : "elementOne"``
- ``"parentObject.nestedArray.deeplyNestedArray" : "elementTwo"``
-.. seealso:: :limit:`Nested Depth for BSON Documents`
+.. seealso::
+
+ :limit:`Nested Depth for BSON Documents`
.. toctree::
:titlesonly:
diff --git a/source/core/journaling.txt b/source/core/journaling.txt
index 23ad6fd2609..33ddcf400f0 100644
--- a/source/core/journaling.txt
+++ b/source/core/journaling.txt
@@ -76,8 +76,8 @@ kB are buffered.
.. seealso::
The :dbcommand:`serverStatus` command returns information on the
- WiredTiger journal statistics in the :data:`wiredTiger.log
- ` field.
+ WiredTiger journal statistics in the :serverstatus:`wiredTiger.log`
+ field.
Journal Files
~~~~~~~~~~~~~
@@ -155,7 +155,9 @@ immediately acknowledged.
.. include:: /includes/extracts/no-journaling-rollback.rst
-.. seealso:: :ref:`In-Memory Storage Engine: Durability `
+.. seealso::
+
+ :ref:`In-Memory Storage Engine: Durability `
.. toctree::
:titlesonly:
diff --git a/source/core/kerberos.txt b/source/core/kerberos.txt
index 697d0c35a32..aa1bdc8e0ad 100644
--- a/source/core/kerberos.txt
+++ b/source/core/kerberos.txt
@@ -73,7 +73,9 @@ that user, see
and
:doc:`/tutorial/control-access-to-mongodb-windows-with-kerberos-authentication`.
-.. seealso:: :doc:`/tutorial/manage-users-and-roles` for
+.. seealso::
+
+ :doc:`/tutorial/manage-users-and-roles` for
general information regarding creating and managing users in
MongoDB.
@@ -189,7 +191,7 @@ The following MongoDB drivers support Kerberos authentication:
- :api:`C `
- `C++ `_
-- :ecosystem:`Java `
+- :driver:`Java `
- `C# `_
- `Node.js `_
- `Perl `_
diff --git a/source/core/map-reduce.txt b/source/core/map-reduce.txt
index ab4b165b563..59aff81d47d 100644
--- a/source/core/map-reduce.txt
+++ b/source/core/map-reduce.txt
@@ -10,8 +10,8 @@ Map-Reduce
:depth: 1
:class: singlecol
-.. admonition:: Aggregation Pipeline as Alternative to Map-Reduce
- :class: note
+
+.. note:: Aggregation Pipeline as Alternative
.. include:: /includes/fact-use-aggregation-not-map-reduce.rst
diff --git a/source/core/query-optimization.txt b/source/core/query-optimization.txt
index b0dbee75eee..34e684bd300 100644
--- a/source/core/query-optimization.txt
+++ b/source/core/query-optimization.txt
@@ -187,7 +187,9 @@ Restrictions on Indexed Fields
- .. include:: /includes/fact-multikey-index-covered-query.rst
- .. seealso:: :ref:`multikey-covering`
+ .. seealso::
+
+ :ref:`multikey-covering`
.. _covered-index-sharded-collection:
diff --git a/source/core/query-plans.txt b/source/core/query-plans.txt
index 4fe4a731241..ca26a8cc0a2 100644
--- a/source/core/query-plans.txt
+++ b/source/core/query-plans.txt
@@ -1,4 +1,4 @@
-.. index:: query optimizer
+
.. _read-operations-query-optimization:
.. _query-plans-query-optimization:
@@ -139,7 +139,9 @@ Users can also:
- Manually clear specific plan cache entries using the
:method:`PlanCache.clearPlansByQuery()` method.
-.. seealso:: :ref:`query-hash-plan-cache-key`
+.. seealso::
+
+ :ref:`query-hash-plan-cache-key`
Plan Cache Debug Info Size Limit
--------------------------------
@@ -219,11 +221,11 @@ The ``queryHash`` and ``planCacheKey`` are available in:
- :pipeline:`$planCacheStats` aggregation stage (*New in MongoDB 4.2*)
-- :method:`PlanCache.listQueryShapes()`
- method/:dbcommand:`planCacheListQueryShapes` command
+- ``PlanCache.listQueryShapes()``
+ method/``planCacheListQueryShapes`` command
-- :method:`PlanCache.getPlansByQuery()`
- method/:dbcommand:`planCacheListPlans` command
+- ``PlanCache.getPlansByQuery()``
+ method/``planCacheListPlans`` command
.. _index-filters:
diff --git a/source/core/read-isolation-consistency-recency.txt b/source/core/read-isolation-consistency-recency.txt
index 568d567051d..bfbc790dfa8 100644
--- a/source/core/read-isolation-consistency-recency.txt
+++ b/source/core/read-isolation-consistency-recency.txt
@@ -10,8 +10,7 @@ Read Isolation, Consistency, and Recency
:depth: 1
:class: singlecol
-.. role:: red(strong)
- :class: text-danger
+
Isolation Guarantees
--------------------
@@ -71,7 +70,9 @@ to perform reads and writes on a single document as if a single thread
performed these operations in real time; that is, the corresponding
schedule for these reads and writes is considered linearizable.
-.. seealso:: :ref:`causal-consistency`
+.. seealso::
+
+ :ref:`causal-consistency`
.. _causal-consistency:
diff --git a/source/core/read-preference-mechanics.txt b/source/core/read-preference-mechanics.txt
index 3bf603eb97a..5556309097b 100644
--- a/source/core/read-preference-mechanics.txt
+++ b/source/core/read-preference-mechanics.txt
@@ -1,4 +1,4 @@
-.. index:: read preference; behavior
+
.. _replica-set-read-preference-behavior:
==========================
@@ -23,9 +23,9 @@ Server selection occurs once per operation.
.. include:: /includes/extracts/transactions-read-pref.rst
-.. index:: read preference; ping time
-.. index:: read preference; nearest
-.. index:: read preference; member selection
+
+
+
.. _replica-set-read-preference-behavior-ping-time:
.. _replica-set-read-preference-behavior-nearest:
.. _replica-set-read-preference-behavior-member-selection:
@@ -40,8 +40,8 @@ is re-evaluated for each operation.
.. include:: /includes/extracts/server-selection-read-preference-replica-sets.rst
-.. index:: read preference; sharding
-.. index:: read preference; mongos
+
+
.. _replica-set-read-preference-behavior-sharding:
.. _replica-set-read-preference-behavior-mongos:
diff --git a/source/core/read-preference-tags.txt b/source/core/read-preference-tags.txt
index 613d391eb47..0968c21a00f 100644
--- a/source/core/read-preference-tags.txt
+++ b/source/core/read-preference-tags.txt
@@ -1,5 +1,5 @@
-.. index:: tag sets
-.. index:: read preference; tag sets
+
+
.. _replica-set-read-preference-tag-sets:
========================
diff --git a/source/core/read-preference.txt b/source/core/read-preference.txt
index 086fb9fe790..f5f52ceb9c9 100644
--- a/source/core/read-preference.txt
+++ b/source/core/read-preference.txt
@@ -1,5 +1,5 @@
-.. index:: read preference
-.. index:: read preference; background
+
+
.. _read-preference:
.. _replica-set-read-preference:
.. _replica-set-read-preference-background:
@@ -210,8 +210,8 @@ Configure Read Preference
-------------------------
When using a MongoDB driver, you can specify the read preference using
-the driver's read preference API. See the driver :ecosystem:`API
-documentation`. You can also set the read preference (except
+the driver's read preference API. See the driver :driver:`API
+documentation >`. You can also set the read preference (except
for the hedged read option) when :ref:`connecting to the replica set or
sharded cluster `. For an example, see
:ref:`connection string `.
diff --git a/source/core/replica-set-arbiter.txt b/source/core/replica-set-arbiter.txt
index 4d3568fd016..4d4d067cfe0 100644
--- a/source/core/replica-set-arbiter.txt
+++ b/source/core/replica-set-arbiter.txt
@@ -1,4 +1,4 @@
-.. index:: replica set members; arbiters
+
.. _replica-set-arbiter-configuration:
===================
@@ -49,8 +49,8 @@ number of votes to break a tie:
Read Concern ``majority`` and Three-Member PSA
----------------------------------------------
-.. admonition:: For 3-Member Primary-Secondary-Arbiter Architecture*
- :class: warning
+.. warning:: For 3-Member Primary-Secondary-Arbiter Architecture*
+
If you have a three-member replica set with a
primary-secondary-arbiter (PSA) architecture or a sharded cluster
diff --git a/source/core/replica-set-architecture-three-members.txt b/source/core/replica-set-architecture-three-members.txt
index a52f7107297..17741b118cd 100644
--- a/source/core/replica-set-architecture-three-members.txt
+++ b/source/core/replica-set-architecture-three-members.txt
@@ -84,4 +84,7 @@ set will elect the secondary to be primary.
.. include:: /images/replica-set-w-arbiter-trigger-election.rst
-.. seealso:: :doc:`/tutorial/deploy-replica-set`.
+.. seealso::
+
+ :doc:`/tutorial/deploy-replica-set`.
+
diff --git a/source/core/replica-set-architectures.txt b/source/core/replica-set-architectures.txt
index 7be9a6169eb..a46996a841c 100644
--- a/source/core/replica-set-architectures.txt
+++ b/source/core/replica-set-architectures.txt
@@ -170,7 +170,9 @@ Use :ref:`replica set tag sets ` to
target read operations to specific members or to customize write
concern to request acknowledgement from specific members.
-.. seealso:: :doc:`/data-center-awareness` and
+.. seealso::
+
+ :doc:`/data-center-awareness` and
:doc:`/core/workload-isolation`.
Use Journaling to Protect Against Power Failures
@@ -198,16 +200,14 @@ patterns. Other patterns are possible and effective depending on
the application's requirements. If needed, combine features of each
architecture in your own deployment:
-.. class:: toc
-
- :doc:`/core/replica-set-architecture-three-members`
- Three-member replica sets provide the minimum recommended
- architecture for a replica set.
+:doc:`/core/replica-set-architecture-three-members`
+ Three-member replica sets provide the minimum recommended
+ architecture for a replica set.
- :doc:`/core/replica-set-architecture-geographically-distributed`
- Geographically distributed sets include members in multiple
- locations to protect against facility-specific failures, such as
- power outages.
+:doc:`/core/replica-set-architecture-geographically-distributed`
+ Geographically distributed sets include members in multiple
+ locations to protect against facility-specific failures, such as
+ power outages.
.. toctree::
diff --git a/source/core/replica-set-delayed-member.txt b/source/core/replica-set-delayed-member.txt
index 65ac68ca788..bdd5a61c384 100644
--- a/source/core/replica-set-delayed-member.txt
+++ b/source/core/replica-set-delayed-member.txt
@@ -1,4 +1,4 @@
-.. index:: replica set members; delayed
+
.. _replica-set-delayed-configuration:
.. _replica-set-delayed-members:
.. _replica-set-delayed-replication:
diff --git a/source/core/replica-set-elections.txt b/source/core/replica-set-elections.txt
index 1cbdd63387b..00b0873ccda 100644
--- a/source/core/replica-set-elections.txt
+++ b/source/core/replica-set-elections.txt
@@ -1,6 +1,6 @@
-.. index:: replica set; network partitions
-.. index:: replica set; elections
-.. index:: replica set; failover
+
+
+
.. _replica-set-election-internals:
.. _replica-set-elections:
@@ -118,7 +118,9 @@ If possible, distribute the replica set members across data centers to
maximize the likelihood that even with a loss of a data center, one of
the remaining replica set members can become the new primary.
-.. seealso:: :doc:`/core/replica-set-architecture-geographically-distributed`
+.. seealso::
+
+ :doc:`/core/replica-set-architecture-geographically-distributed`
Network Partition
~~~~~~~~~~~~~~~~~
@@ -131,14 +133,14 @@ partition that can communicate with a :data:`majority
` of the nodes (including itself)
holds an election to become the new primary.
-.. index:: replica set members; non-voting
+-voting
Voting Members
--------------
The replica set member configuration setting :rsconf:`members[n].votes`
-and member :data:`~replSetGetStatus.members.state` determine whether a
+and member :data:`~replSetGetStatus.members[n].state` determine whether a
member votes in an election.
diff --git a/source/core/replica-set-hidden-member.txt b/source/core/replica-set-hidden-member.txt
index a93c0d6d2d2..c9ff657e579 100644
--- a/source/core/replica-set-hidden-member.txt
+++ b/source/core/replica-set-hidden-member.txt
@@ -1,4 +1,4 @@
-.. index:: replica set members; hidden
+
.. _replica-set-hidden-configuration:
.. _replica-set-hidden-members:
diff --git a/source/core/replica-set-high-availability.txt b/source/core/replica-set-high-availability.txt
index a218ffea6f1..3a98232a650 100644
--- a/source/core/replica-set-high-availability.txt
+++ b/source/core/replica-set-high-availability.txt
@@ -1,4 +1,4 @@
-.. index:: pair: replica set; failover
+: replica set; failover
.. _replica-set-failover-administration:
.. _replica-set-failover:
.. _failover:
@@ -18,15 +18,13 @@ Replica Set High Availability
Replica sets use elections to support
:term:`high availability `.
-.. class:: toc
+:doc:`/core/replica-set-elections`
+ Elections occur when the primary becomes unavailable and the
+ replica set members autonomously select a new primary.
- :doc:`/core/replica-set-elections`
- Elections occur when the primary becomes unavailable and the
- replica set members autonomously select a new primary.
-
- :doc:`/core/replica-set-rollbacks`
- A rollback reverts write operations on a former primary when the
- member rejoins the replica set after a failover.
+:doc:`/core/replica-set-rollbacks`
+ A rollback reverts write operations on a former primary when the
+ member rejoins the replica set after a failover.
.. toctree::
diff --git a/source/core/replica-set-members.txt b/source/core/replica-set-members.txt
index 72d3abf7ace..17c384fbec9 100644
--- a/source/core/replica-set-members.txt
+++ b/source/core/replica-set-members.txt
@@ -43,16 +43,15 @@ A replica set can have up to :ref:`50 members
- :data:`replSetGetStatus.writableVotingMembersCount`
-.. only:: (website or singlehtml)
- .. _replica-set-primary-member:
+.. _replica-set-primary-member:
- Primary
- -------
+Primary
+-------
- .. include:: /core/replica-set-primary.txt
- :start-after: start-content
- :end-before: start-content-election-example
+.. include:: /core/replica-set-primary.txt
+ :start-after: start-content
+ :end-before: start-content-election-example
.. toctree::
:titlesonly:
@@ -60,20 +59,18 @@ A replica set can have up to :ref:`50 members
/core/replica-set-primary
-.. only:: (website or singlehtml)
+.. _replica-set-secondary-members:
- .. _replica-set-secondary-members:
+Secondaries
+-----------
- Secondaries
- -----------
+.. include:: /core/replica-set-secondary.txt
+ :start-after: start-content
+ :end-before: start-content-election-example
- .. include:: /core/replica-set-secondary.txt
- :start-after: start-content
- :end-before: start-content-election-example
-
- .. include:: /core/replica-set-secondary.txt
- :start-after: end-content-election-example
- :end-before: end-content
+.. include:: /core/replica-set-secondary.txt
+ :start-after: end-content-election-example
+ :end-before: end-content
.. toctree::
:titlesonly:
@@ -81,18 +78,17 @@ A replica set can have up to :ref:`50 members
/core/replica-set-secondary
-.. only:: (website or singlehtml)
- .. _replica-set-arbiters:
+.. _replica-set-arbiters:
- Arbiter
- -------
+Arbiter
+-------
- .. include:: /core/replica-set-arbiter.txt
- :start-after: start-content
- :end-before: end-content
+.. include:: /core/replica-set-arbiter.txt
+ :start-after: start-content
+ :end-before: end-content
- For considerations when using an arbiter, see :doc:`/core/replica-set-arbiter`.
+For considerations when using an arbiter, see :doc:`/core/replica-set-arbiter`.
.. toctree::
:titlesonly:
diff --git a/source/core/replica-set-rollbacks.txt b/source/core/replica-set-rollbacks.txt
index 73c4f9a08f9..a7b9ad6c5c3 100644
--- a/source/core/replica-set-rollbacks.txt
+++ b/source/core/replica-set-rollbacks.txt
@@ -1,4 +1,4 @@
-.. index:: rollbacks
+
single: replica set; rollbacks
single: consistency; rollbacks
@@ -57,8 +57,8 @@ Rollback Data
By default, when a rollback occurs, MongoDB writes the rollback data to
:term:`BSON` files.
-.. admonition:: Rollback Directory Change
- :class: note
+.. note:: Rollback Directory Change
+
Starting in Mongo 4.4, the rollback directory for a collection is named
after the collection's UUID rather than the collection namespace.
@@ -67,29 +67,27 @@ By default, when a rollback occurs, MongoDB writes the rollback data to
.. tab:: MongoDB 4.4+
:tabid: 4.4
-
- .. container::
+
+ For each collection whose data is rolled back, the
+ rollback files are located in a ``/rollback/``
+ directory and have filenames of the form:
- For each collection whose data is rolled back, the
- rollback files are located in a ``/rollback/``
- directory and have filenames of the form:
+ .. code-block:: none
+ :copyable: false
- .. code-block:: none
- :copyable: false
+ removed..bson
- removed..bson
+ For example, if data for the collection ``comments`` in the
+ ``reporting`` database rolled back:
- For example, if data for the collection ``comments`` in the
- ``reporting`` database rolled back:
-
- .. code-block:: none
- :copyable: false
+ .. code-block:: none
+ :copyable: false
- /rollback/20f74796-d5ea-42f5-8c95-f79b39bad190/removed.2020-02-19T04-57-11.0.bson
+ /rollback/20f74796-d5ea-42f5-8c95-f79b39bad190/removed.2020-02-19T04-57-11.0.bson
- where ```` is the :binary:`~bin.mongod`'s :setting:`~storage.dbPath`.
+ where ```` is the :binary:`~bin.mongod`'s :setting:`~storage.dbPath`.
- .. topic:: Collection Name
+ .. tip:: Collection Name
To get the collection name, you can search for ``rollback
file`` in the MongoDB log. For example, if the log file is
@@ -124,45 +122,40 @@ By default, when a rollback occurs, MongoDB writes the rollback data to
.. tab:: MongoDB 4.2-4.0
:tabid: 4.2
-
- .. container::
+ For each collection whose data is rolled back, the
+ rollback files are located in a ``/rollback/.``
+ directory and have filenames of the form:
- For each collection whose data is rolled back, the
- rollback files are located in a ``/rollback/.``
- directory and have filenames of the form:
+ .. code-block:: none
+ :copyable: false
- .. code-block:: none
- :copyable: false
+ removed..bson
- removed..bson
+ For example, if data for the collection ``comments`` in the
+ ``reporting`` database rolled back:
- For example, if data for the collection ``comments`` in the
- ``reporting`` database rolled back:
-
- .. code-block:: none
- :copyable: false
+ .. code-block:: none
+ :copyable: false
- /rollback/reporting.comments/removed.2019-01-31T02-57-40.0.bson
+ /rollback/reporting.comments/removed.2019-01-31T02-57-40.0.bson
- where ```` is the :binary:`~bin.mongod`'s :setting:`~storage.dbPath`.
+ where ```` is the :binary:`~bin.mongod`'s :setting:`~storage.dbPath`.
.. tab:: MongoDB 3.6 and earlier
:tabid: 3.6
- .. container::
-
- In versions 3.6 and earlier, rollback files are located directly under the
- ``/rollback`` directory with the filenames of the form
- ``...bson``.
-
- For example, if data for the collection ``comments`` in the
- ``reporting`` database rolled back:
+ In versions 3.6 and earlier, rollback files are located directly under the
+ ``/rollback`` directory with the filenames of the form
+ ``...bson``.
+
+ For example, if data for the collection ``comments`` in the
+ ``reporting`` database rolled back:
- .. code-block:: none
- :copyable: false
+ .. code-block:: none
+ :copyable: false
- /rollbacktest.col.2020-02-19T04-46-22.0.bson
+ /rollbacktest.col.2020-02-19T04-46-22.0.bson
Rollback Data Exclusion
~~~~~~~~~~~~~~~~~~~~~~~
@@ -261,5 +254,7 @@ In MongoDB 3.6 and earlier, the rollback time limit is not configurable.
For these versions, rollback is limited by the amount of data, with a
maximum of 300 megabytes.
-.. seealso:: :doc:`/core/replica-set-high-availability` and
+.. seealso::
+
+ :doc:`/core/replica-set-high-availability` and
:doc:`/core/replica-set-elections`.
diff --git a/source/core/replica-set-write-concern.txt b/source/core/replica-set-write-concern.txt
index ddada79ba3f..93cdf826353 100644
--- a/source/core/replica-set-write-concern.txt
+++ b/source/core/replica-set-write-concern.txt
@@ -18,7 +18,7 @@ write operation after it has received and applied the write
successfully.
For replica sets, the default write concern of
-:writeconcern:`w: 1 >` requires that only the primary
+:writeconcern:`w: 1 <\>` requires that only the primary
replica set member acknowledge the write before returning
write concern acknowledgment. You can specify an integer
value greater than ``1`` to require acknowledgment from the primary and
@@ -116,7 +116,9 @@ the :dbcommand:`setDefaultRWConcern` command.
If you issue a write operation with a specific write concern, the write
operation uses its own write concern instead of the default.
-.. seealso:: :doc:`/reference/write-concern`
+.. seealso::
+
+ :doc:`/reference/write-concern`
Custom Write Concerns
---------------------
diff --git a/source/core/retryable-writes.txt b/source/core/retryable-writes.txt
index 8d62165f375..1470ec5d3fa 100644
--- a/source/core/retryable-writes.txt
+++ b/source/core/retryable-writes.txt
@@ -88,7 +88,7 @@ Retryable Write Operations
The following write operations are retryable when issued with
acknowledged write concern; e.g., :doc:`/reference/write-concern`
-cannot be :writeconcern:`{w: 0} >`.
+cannot be :writeconcern:`{w: 0} <\>`.
.. note::
diff --git a/source/core/schema-validation.txt b/source/core/schema-validation.txt
index 806a6fad15f..7255648058b 100644
--- a/source/core/schema-validation.txt
+++ b/source/core/schema-validation.txt
@@ -125,8 +125,6 @@ validation with :ref:`other query operators
For example, the following example specifies validator rules using the
query expression:
-.. cssclass:: copyable-code
-
.. code-block:: sh
db.createCollection( "contacts",
@@ -139,7 +137,9 @@ query expression:
}
} )
-.. seealso:: :ref:`query operators `
+.. seealso::
+
+ :ref:`query operators `
Behavior
--------
@@ -166,8 +166,6 @@ applies the validation rules:
For example, create a ``contacts`` collection with the following
documents:
-.. cssclass:: copyable-code
-
.. code-block:: json
db.contacts.insert([
@@ -178,8 +176,6 @@ documents:
Issue the following command to add a validator to the ``contacts``
collection:
-.. cssclass:: copyable-code
-
.. code-block:: sh
db.runCommand( {
@@ -304,8 +300,6 @@ documents that violate the validation rules:
For example, create a ``contacts2`` collection with the following JSON
Schema validator:
-.. cssclass:: copyable-code
-
.. code-block:: json
db.createCollection( "contacts2", {
@@ -424,5 +418,8 @@ validation, the authenticated user must have
Additional Information
----------------------
-.. seealso:: :dbcommand:`collMod`, :method:`db.createCollection()`,
+.. seealso::
+
+ :dbcommand:`collMod`, :method:`db.createCollection()`,
+
:method:`db.getCollectionInfos()`.
diff --git a/source/core/security-client-side-encryption-key-management.txt b/source/core/security-client-side-encryption-key-management.txt
index cbd964753ed..076850f0bf2 100644
--- a/source/core/security-client-side-encryption-key-management.txt
+++ b/source/core/security-client-side-encryption-key-management.txt
@@ -71,8 +71,7 @@ Key must have at least one policy with the following actions:
`(reference)
`__
-.. admonition:: Implement Principle of Least Privilege for KMS Access
- :class: note
+.. note:: Implement Principle of Least Privilege for KMS Access
Consider configuring IAM user roles such that MongoDB has only the
access to the actions and resources required to function.
diff --git a/source/core/security-client-side-encryption.txt b/source/core/security-client-side-encryption.txt
index 675834fd68d..d4d3218e172 100644
--- a/source/core/security-client-side-encryption.txt
+++ b/source/core/security-client-side-encryption.txt
@@ -66,7 +66,7 @@ Consider the following document:
With client-side field level encryption, the application can
specifically encrypt sensitive information like the ``ssn``
and ``phone``. Encrypted fields are stored as
-:bsontype:`binary data ` with
+:bsontype:`binary data ` with
`subtype 6 `_:
.. code-block:: json
@@ -88,8 +88,8 @@ for client-side field level encryption, see
For an end-to-end procedure for configuring field level encryption using
select MongoDB 4.2-compatible drivers, see the
-:ecosystem:`Client Side Field Level Encryption Guide
-`.
+:driver:`Client Side Field Level Encryption Guide
+`.
Supported Encryption Methods
----------------------------
@@ -311,7 +311,7 @@ collection. Use the :ref:`automatic encryption rule keywords
` with the
:query:`$jsonSchema` validation object to indicate which fields require
encryption. The server rejects any write operations to that collection
-where the specified fields are not :bsontype:`Binary (BinData) `
+where the specified fields are not :bsontype:`Binary (BinData) `
subtype 6 objects.
For example, the following :dbcommand:`collMod` command modifies
@@ -367,7 +367,7 @@ Clients performing :ref:`automatic client-side field level encryption
on the :ref:`database connection configuration
`:
-.. container::
+.. note::
*Automatic client-side field level encryption is available with
MongoDB 4.2 Enterprise only.*
@@ -424,39 +424,39 @@ the following official 4.2-compatible driver versions:
- Supported Versions
- Quickstarts / Tutorials
- * - :ecosystem:`Node `
+ * - :driverecosystem:`Node `
- ``3.4.0+``
- | `Node.js Quickstart `__
- | :ecosystem:`Client-Side Field Level Encryption Guide `
+ | :driver:`Client-Side Field Level Encryption Guide `
- * - :ecosystem:`Java `
+ * - :driver:`Java `
- ``3.12.0+``
- | `Java Driver Quickstart `__
| `Java Async Driver Quickstart `__
- | :ecosystem:`Client-Side Field Level Encryption Guide `
+ | :driver:`Client-Side Field Level Encryption Guide `
* - `Java Reactive Streams `__
- ``1.13.0+``
- `Java RS Documentation `__
- * - :ecosystem:`Python (PyMongo) `
+ * - :driver:`Python (PyMongo) `
- ``3.10.0+``
- | `Python Driver Quickstart `__
- | :ecosystem:`Client-Side Field Level Encryption Guide `
+ | :driver:`Client-Side Field Level Encryption Guide `
- * - :ecosystem:`C#/.NET `
+ * - :driver:`C#/.NET `
- ``2.10.0+``
- `.NET Driver Quickstart `__
- * - :ecosystem:`Go `
+ * - :driver:`Go `
- ``1.2+``
- `Go Driver Quickstart `__
- * - :ecosystem:`Scala `
+ * - :driver:`Scala `
- ``2.8.0+``
- `Scala Documentation `__
- * - :ecosystem:`PHP `
+ * - :driver:`PHP `
- ``1.6.0+``
- `PHP Driver Quickstart `__
diff --git a/source/core/security-encryption-at-rest.txt b/source/core/security-encryption-at-rest.txt
index 9ad73fcbd80..a6f9fc1b286 100644
--- a/source/core/security-encryption-at-rest.txt
+++ b/source/core/security-encryption-at-rest.txt
@@ -10,8 +10,7 @@ Encryption at Rest
:depth: 1
:class: singlecol
-.. role:: red(strong)
- :class: text-danger
+
Encryption at rest, when used in conjunction with transport encryption
and good security policies that protect relevant accounts, passwords,
@@ -37,8 +36,8 @@ read the data.
Encryption Process
~~~~~~~~~~~~~~~~~~
-.. admonition:: Changed in version 4.0
- :class: note
+.. note:: Changed in version 4.0
+
.. include:: /includes/fact-aes.rst
diff --git a/source/core/security-ldap-external.txt b/source/core/security-ldap-external.txt
index 74740e3bd82..4d4625905f1 100644
--- a/source/core/security-ldap-external.txt
+++ b/source/core/security-ldap-external.txt
@@ -293,7 +293,7 @@ configuration file:
Defaults to ``DIGEST-MD5``.
- - **NO**, unless setting :setting:`~security.ldap.bindMethod` to
+ - **NO**, unless setting :setting:`~security.ldap.bind.method` to
``sasl``, and you need different or additional SASL mechanisms.
* - :setting:`security.ldap.bind.useOSDefaults`
@@ -308,10 +308,11 @@ configuration file:
* - :setting:`security.ldap.userToDNMapping`
- - Depending on your :setting:`~security.ldap.queryTemplate`, the
- authenticated client username may require transformation to support the
- LDAP query URL. :setting:`~security.ldap.userToDNMapping` allows
- MongoDB to transform incoming usernames.
+ - Depending on your :setting:`~security.ldap.authz.queryTemplate`,
+ the authenticated client username may require transformation to
+ support the LDAP query URL.
+ :setting:`~security.ldap.userToDNMapping` allows MongoDB to
+ transform incoming usernames.
- **NO**, unless client usernames require transformation into LDAP DNs.
@@ -353,7 +354,9 @@ The LDAP query URL must conform to the format defined in `RFC4516
[ dn [ ? [attributes] [ ? [scope] [ ? [filter] [ ? [Extensions] ] ] ] ] ]
-Consider the definition of each component, as quoted from RFC4516::
+Consider the definition of each component, as quoted from RFC4516:
+
+.. blockquote::
The ``dn`` is an LDAP Distinguished Name using the string format described
in `RFC4514 `_. It identifies the base
@@ -446,7 +449,7 @@ MongoDB Roles for LDAP Authorization
------------------------------------
MongoDB maps each returned group distinguished name (DN) returned by
-the LDAP :setting:`query ` to a
+the LDAP :setting:`query ` to a
:ref:`role ` on the ``admin`` database.
If MongoDB acquires a group whose DN **exactly** matches the name of an
@@ -494,7 +497,7 @@ privileges to the user.
After authenticating a user ``alice@dba.example.com`` against the
``$external`` database, the MongoDB server performs a query derived from
the configured :setting:`query template
- ` to retrieve the groups which include
+ ` to retrieve the groups which include
the authenticated user as a member. In this example, the MongoDB server
retrieves the following group DNs for the user:
diff --git a/source/core/security-ldap.txt b/source/core/security-ldap.txt
index 3fd6e9b15f5..bda71692e88 100644
--- a/source/core/security-ldap.txt
+++ b/source/core/security-ldap.txt
@@ -262,13 +262,14 @@ configuration file:
- The password used to authenticate to an LDAP server when using
:setting:`~security.ldap.bind.queryUser`.
- - **NO**, unless specifying :setting:`~security.ldap.queryUser`
+ - **NO**, unless specifying
+ :setting:`~security.ldap.bind.queryUser`.
* - :setting:`security.ldap.bind.useOSDefaults`
- Windows MongoDB deployments can use the operating system credentials in
- place of :setting:`~security.ldap.queryUser` and
- :setting:`~security.ldap.queryPassword` for authenticating or binding
+ place of :setting:`~security.ldap.bind.queryUser` and
+ :setting:`~security.ldap.bind.queryPassword` for authenticating or binding
as when connecting to the LDAP server.
- **NO**, unless replacing :setting:`~security.ldap.bind.queryUser` and
@@ -288,9 +289,10 @@ configuration file:
or an LDAP query template.
If you specify a :setting:`~security.ldap.userToDNMapping`
- transformation that uses LDAP queries as part of the transformation,
- you must also specify a :setting:`~security.ldap.queryUser` with
- the appropriate level of permissions for the LDAP server
+ transformation that uses LDAP queries as part of the
+ transformation, you must also specify a
+ :setting:`~security.ldap.bind.queryUser` with the appropriate
+ level of permissions for the LDAP server
- **NO**, unless client authenticate using usernames that require
transformation.
diff --git a/source/core/security-users.txt b/source/core/security-users.txt
index 7604ac88dc2..b1ca89cf9cb 100644
--- a/source/core/security-users.txt
+++ b/source/core/security-users.txt
@@ -38,7 +38,9 @@ A user is uniquely identified by the user's name and associated
authentication database. Starting in MongoDB 4.0.9, a users managed by
MongoDB are assigned a unique ``userId``. [#userid]_
-.. seealso:: :doc:`/tutorial/create-users`
+.. seealso::
+
+ :doc:`/tutorial/create-users`
.. _authentication-database:
.. _user-authentication-database:
@@ -92,7 +94,7 @@ database.
Do not access this collection directly but instead use the :ref:`user
management commands `.
-.. index:: sharding; localhost
+
.. _sharding-localhost:
.. _sharding-security:
diff --git a/source/core/sharded-cluster-components.txt b/source/core/sharded-cluster-components.txt
index 47e4e8b4c8b..8726b589495 100644
--- a/source/core/sharded-cluster-components.txt
+++ b/source/core/sharded-cluster-components.txt
@@ -1,5 +1,5 @@
-.. index:: sharding; shards
-.. index:: shards
+
+
.. _sharding-shards:
.. _sharding-production-architecture:
@@ -111,7 +111,9 @@ following components:
.. warning:: Use the test cluster architecture for testing and
development only.
-.. seealso:: :doc:`/tutorial/deploy-shard-cluster/`
+.. seealso::
+
+ :doc:`/tutorial/deploy-shard-cluster/`
.. toctree::
:titlesonly:
diff --git a/source/core/sharded-cluster-config-servers.txt b/source/core/sharded-cluster-config-servers.txt
index 79e11e78ff0..bedc52f667e 100644
--- a/source/core/sharded-cluster-config-servers.txt
+++ b/source/core/sharded-cluster-config-servers.txt
@@ -1,5 +1,5 @@
-.. index:: sharding; config servers
-.. index:: config servers
+
+
.. _sharding-config-server:
.. _sharded-cluster-config-server:
@@ -61,8 +61,8 @@ Replica Set Config Servers
.. include:: /includes/fact-config-server-replica-set-restrictions.rst
-.. index:: config databases
-.. index:: database, config
+
+, config
.. _config-server-read-write-ops:
diff --git a/source/core/sharded-cluster-query-router.txt b/source/core/sharded-cluster-query-router.txt
index b5a67acc571..c1fd983a579 100644
--- a/source/core/sharded-cluster-query-router.txt
+++ b/source/core/sharded-cluster-query-router.txt
@@ -1,4 +1,4 @@
-.. index:: mongos
+
.. _sharded-cluster-query-routing:
.. _sharding-read-operations:
@@ -76,7 +76,7 @@ retrieves the results.
For more information on how the work of aggregation is split among
components of a sharded cluster query, use ``explain:true`` as a
- parameter to the :method:`~db.collection.aggregation()` call. The
+ parameter to the :method:`~db.collection.aggregate()` call. The
return will include three json objects. ``mergeType`` shows where the
stage of the merge happens ("primaryShard", "anyShard", or "mongos").
``splitPipeline`` shows which operations in your pipeline have run on
@@ -168,44 +168,38 @@ The additional read sent to hedge the read operation uses the
Hedged Reads and Read Preference
````````````````````````````````
-.. container::
+Hedged reads are specified per operation as part of the :doc:`read
+preference `. Non-``primary`` :doc:`read preferences
+` support hedged reads. See :ref:`Hedged Read
+Preference Option `.
- Hedged reads are specified per operation as part of the :doc:`read
- preference `. Non-``primary`` :doc:`read preferences
- ` support hedged reads. See :ref:`Hedged Read
- Preference Option `.
+- To specify hedged read for a non-``primary`` read preference,
+ refer to the driver :driver:`read preference API
+ documentation>`.
- - To specify hedged read for a non-``primary`` read preference,
- refer to the driver :ecosystem:`read preference API
- documentation`.
+- Read preference :readmode:`nearest` enables the hedged read option
+ by default.
- - Read preference :readmode:`nearest` enables the hedged read option
- by default.
+For details on read preference and sharded clusters as well as member
+selection, see :ref:`read-preference-mechanics-sharded-cluster`.
- For details on read preference and sharded clusters as well as member
- selection, see :ref:`read-preference-mechanics-sharded-cluster`.
-
Enable/Disable Support for Hedged Reads
```````````````````````````````````````
-.. container::
-
- By default, :binary:`~bin.mongos` instances support using hedged
- reads. To turn off a :binary:`~bin.mongos` instance's support for
- hedged reads, see the :parameter:`readHedgingMode` parameter. If the
- hedged read support is ``off``, :binary:`~bin.mongos` does not use
- hedged reads regardless of the ``hedge`` option specified for the
- read preference.
+By default, :binary:`~bin.mongos` instances support using hedged
+reads. To turn off a :binary:`~bin.mongos` instance's support for
+hedged reads, see the :parameter:`readHedgingMode` parameter. If the
+hedged read support is ``off``, :binary:`~bin.mongos` does not use
+hedged reads regardless of the ``hedge`` option specified for the
+read preference.
Hedged Reads Diagnostics
````````````````````````
-.. container::
-
- The command :dbcommand:`serverStatus` and its corresponding
- :binary:`~bin.mongo` shell method :method:`db.serverStatus()` return
- :serverstatus:`hedgingMetrics`.
+The command :dbcommand:`serverStatus` and its corresponding
+:binary:`~bin.mongo` shell method :method:`db.serverStatus()` return
+:serverstatus:`hedgingMetrics`.
Confirm Connection to ``mongos`` Instances
------------------------------------------
@@ -229,7 +223,7 @@ a document with a ``msg`` field that holds the string
If the application is instead connected to a :binary:`~bin.mongod`, the
returned document does not include the ``isdbgrid`` string.
-.. index:: shard key; query isolation
+
.. _sharding-query-router-broadcast-targeted:
.. _sharding-shard-key-query-isolation:
.. _sharding-query-isolation:
diff --git a/source/core/sharded-cluster-requirements.txt b/source/core/sharded-cluster-requirements.txt
index 6b20ada977e..140b4c88c9b 100644
--- a/source/core/sharded-cluster-requirements.txt
+++ b/source/core/sharded-cluster-requirements.txt
@@ -1,4 +1,4 @@
-.. index:: fundamentals; sharding
+
.. _sharding-fundamentals:
.. _sharding-capacity-planning:
diff --git a/source/core/sharded-cluster-shards.txt b/source/core/sharded-cluster-shards.txt
index 0056198af27..c4d852e3253 100644
--- a/source/core/sharded-cluster-shards.txt
+++ b/source/core/sharded-cluster-shards.txt
@@ -42,7 +42,7 @@ replica set.
The :binary:`~bin.mongos` selects the primary shard when creating a new database
by picking the shard in the cluster that has the least amount of data.
:binary:`~bin.mongos` uses the ``totalSize`` field returned by the
-:dbcommand:`listDatabase` command as a part of the selection criteria.
+:dbcommand:`listDatabases` command as a part of the selection criteria.
.. include:: /images/sharded-cluster-primary-shard.rst
diff --git a/source/core/sharding-balancer-administration.txt b/source/core/sharding-balancer-administration.txt
index 5bb9e2911e0..99778f073d9 100644
--- a/source/core/sharding-balancer-administration.txt
+++ b/source/core/sharding-balancer-administration.txt
@@ -1,4 +1,4 @@
-.. index:: balancing; migration
+
.. _sharding-balancing:
========================
@@ -36,7 +36,7 @@ The balancer runs on the primary of the config server replica set
/tutorial/manage-sharded-cluster-balancer
/tutorial/migrate-chunks-in-sharded-cluster
-.. index:: balancing; internals
+
.. _sharding-balancing-internals:
.. _sharding-internals-balancing:
@@ -93,7 +93,10 @@ Window ` for details.
The specification of the balancing window is relative to the local
time zone of the primary of the config server replica set.
-.. seealso:: :doc:`/tutorial/manage-sharded-cluster-balancer`.
+.. seealso::
+
+ :doc:`/tutorial/manage-sharded-cluster-balancer`.
+
.. [#auto-distribute]
@@ -124,7 +127,10 @@ to the removed shard during this process.
See the :doc:`/tutorial/remove-shards-from-cluster` tutorial for
instructions on safely removing a shard from a cluster.
-.. seealso:: :method:`sh.balancerCollectionStatus()`
+.. seealso::
+
+ :method:`sh.balancerCollectionStatus()`
+
.. _chunk-migration-procedure:
@@ -175,7 +181,10 @@ All chunk migrations use the following procedure:
The migration process ensures consistency and maximizes the availability of
chunks during balancing.
-.. seealso:: :serverstatus:`shardingStatistics.countDonorMoveChunkLockTimeout`
+.. seealso::
+
+ :serverstatus:`shardingStatistics.countDonorMoveChunkLockTimeout`
+
.. _sharding-migration-thresholds:
@@ -209,7 +218,10 @@ The balancer stops running on the target collection when the difference
between the number of chunks on any two shards for that collection is *less
than two*, or a chunk migration fails.
-.. seealso:: :method:`sh.balancerCollectionStatus()`
+.. seealso::
+
+ :method:`sh.balancerCollectionStatus()`
+
.. _chunk-migration-queuing:
.. _asynchronous-chunk-migration-cleanup:
diff --git a/source/core/sharding-data-partitioning.txt b/source/core/sharding-data-partitioning.txt
index b79447bac0f..a9e44ed647f 100644
--- a/source/core/sharding-data-partitioning.txt
+++ b/source/core/sharding-data-partitioning.txt
@@ -35,66 +35,66 @@ Initial Chunks
Populated Collection
~~~~~~~~~~~~~~~~~~~~
-.. container::
+- The sharding operation creates the initial chunk(s) to cover the
+ entire range of the shard key values. The number of chunks created
+ depends on the :ref:`configured chunk size `.
- - The sharding operation creates the initial chunk(s) to cover the
- entire range of the shard key values. The number of chunks created
- depends on the :ref:`configured chunk size `.
-
- - After the initial chunk creation, the balancer migrates these initial
- chunks across the shards as appropriate as well as manages the chunk
- distribution going forward.
+- After the initial chunk creation, the balancer migrates these initial
+ chunks across the shards as appropriate as well as manages the chunk
+ distribution going forward.
.. _initial-chunks-empty-collection:
Empty Collection
~~~~~~~~~~~~~~~~
-.. container::
+- If you define :doc:`zones and zone ranges ` defined
+ for an empty or non-existing collection (Available starting in
+ MongoDB 4.0.3):
+
+ - The sharding operation creates empty chunks for the defined zone
+ ranges as well as any additional chunks to cover the entire range
+ of the shard key values and performs an initial chunk distribution
+ based on the zone ranges. This initial creation and distribution of
+ chunks allows for faster setup of zoned sharding.
- - If you define :doc:`zones and zone ranges ` defined
- for an empty or non-existing collection (Available starting in
- MongoDB 4.0.3):
+ - After the initial distribution, the balancer manages the chunk
+ distribution going forward.
- - The sharding operation creates empty chunks for the defined zone
- ranges as well as any additional chunks to cover the entire range
- of the shard key values and performs an initial chunk distribution
- based on the zone ranges. This initial creation and distribution of
- chunks allows for faster setup of zoned sharding.
- - After the initial distribution, the balancer manages the chunk
- distribution going forward.
+- If you do not have :doc:`zones and zone ranges ` defined
+ for an empty or non-existing collection:
+ - For hashed sharding:
- - If you do not have :doc:`zones and zone ranges ` defined
- for an empty or non-existing collection:
+ - The sharding operation creates empty chunks to cover the
+ entire range of the shard key values and performs an initial
+ chunk distribution. By default, the
+ operation creates 2 chunks per shard and migrates across the
+ cluster. You can use ``numInitialChunks`` option to specify a
+ different number of initial chunks. This initial creation and
+ distribution of chunks allows for faster setup of
+ sharding.
- - For hashed sharding:
+ - After the initial distribution, the balancer manages the chunk
+ distribution going forward.
- - The sharding operation creates empty chunks to cover the
- entire range of the shard key values and performs an initial
- chunk distribution. By default, the
- operation creates 2 chunks per shard and migrates across the
- cluster. You can use ``numInitialChunks`` option to specify a
- different number of initial chunks. This initial creation and
- distribution of chunks allows for faster setup of
- sharding.
+ - For ranged sharding:
- - After the initial distribution, the balancer manages the chunk
- distribution going forward.
+ - The sharding operation creates a single empty chunk to cover the
+ entire range of the shard key values.
- - For ranged sharding:
+ - After the initial chunk creation, the balancer migrates the
+ initial chunk across the shards as appropriate as well as manages
+ the chunk distribution going forward.
- - The sharding operation creates a single empty chunk to cover the
- entire range of the shard key values.
+.. seealso::
- - After the initial chunk creation, the balancer migrates the
- initial chunk across the shards as appropriate as well as manages
- the chunk distribution going forward.
+
+
+ :method:`sh.balancerCollectionStatus()`
-.. seealso:: :method:`sh.balancerCollectionStatus()`
-.. index:: sharding; chunk size
.. _sharding-chunk-size:
Chunk Size
@@ -182,7 +182,11 @@ either:
For more information on the sharded cluster :term:`balancer`, see
:ref:`sharding-balancing`.
-.. seealso:: :serverstatus:`shardingStatistics.countDonorMoveChunkLockTimeout`
+.. seealso::
+
+
+
+ :serverstatus:`shardingStatistics.countDonorMoveChunkLockTimeout`
Balancing
~~~~~~~~~
diff --git a/source/core/sharding-shard-key.txt b/source/core/sharding-shard-key.txt
index 3598ebdfbe3..4519b9b1426 100644
--- a/source/core/sharding-shard-key.txt
+++ b/source/core/sharding-shard-key.txt
@@ -1,4 +1,4 @@
-.. index:: shard key
+
single: sharding; shard key
.. _sharding-shard-key:
@@ -11,8 +11,7 @@ Shard Keys
.. default-domain:: mongodb
-.. role:: red(strong)
- :class: text-danger
+
.. contents:: On this page
:local:
@@ -89,26 +88,24 @@ For more information on the sharding method, see
Refine a Shard Key
------------------
-.. container::
+Starting in MongoDB 4.4, you can use
+:dbcommand:`refineCollectionShardKey` to refine a collection's shard
+key. The :dbcommand:`refineCollectionShardKey` adds a suffix field
+or fields to the existing key to create the new shard key.
- Starting in MongoDB 4.4, you can use
- :dbcommand:`refineCollectionShardKey` to refine a collection's shard
- key. The :dbcommand:`refineCollectionShardKey` adds a suffix field
- or fields to the existing key to create the new shard key.
+For example, you may have an existing ``orders`` collection with the
+shard key ``{ customer_id: 1 }``. You can change the shard key by
+adding a suffix ``order_id`` field to the shard key so that ``{
+customer_id: 1, order_id: 1 }`` becomes the new shard key. For more
+information, see the :dbcommand:`refineCollectionShardKey` command.
- For example, you may have an existing ``orders`` collection with the
- shard key ``{ customer_id: 1 }``. You can change the shard key by
- adding a suffix ``order_id`` field to the shard key so that ``{
- customer_id: 1, order_id: 1 }`` becomes the new shard key. For more
- information, see the :dbcommand:`refineCollectionShardKey` command.
+Refining a collection's shard key allows for a more fine-grained
+data distribution and can address situations where the existing key
+has led to :ref:`jumbo (i.e. indivisible) chunks ` due
+to insufficient cardinality.
- Refining a collection's shard key allows for a more fine-grained
- data distribution and can address situations where the existing key
- has led to :ref:`jumbo (i.e. indivisible) chunks ` due
- to insufficient cardinality.
-
- In MongoDB 4.2 and earlier, the choice of shard key cannot be changed
- after sharding.
+In MongoDB 4.2 and earlier, the choice of shard key cannot be changed
+after sharding.
.. _sharding-internals-shard-key-indexes:
.. _sharding-shard-key-indexes:
@@ -143,56 +140,53 @@ of the shard key.
For a ranged sharded collection, only the following indexes can be
:doc:`unique `:
-.. container::
-
- - the index on the shard key
+- the index on the shard key
- - a :term:`compound index` where the shard key is a :ref:`prefix
- `
+- a :term:`compound index` where the shard key is a :ref:`prefix
+ `
- - the default ``_id`` index; **however**, the ``_id`` index only
- enforces the uniqueness constraint per shard **if** the ``_id`` field
- is **not** the shard key or the prefix of the shard key.
+- the default ``_id`` index; **however**, the ``_id`` index only
+ enforces the uniqueness constraint per shard **if** the ``_id`` field
+ is **not** the shard key or the prefix of the shard key.
- .. admonition:: Uniqueness and the ``_id`` Index
- :class: important
+ .. important:: Uniqueness and the ``_id`` Index
- If the ``_id`` field is not the shard key or the prefix of the
- shard key, ``_id`` index only enforces the uniqueness constraint
- per shard and **not** across shards.
+ If the ``_id`` field is not the shard key or the prefix of the
+ shard key, ``_id`` index only enforces the uniqueness constraint
+ per shard and **not** across shards.
- For example, consider a sharded collection (with shard key ``{x:
- 1}``) that spans two shards A and B. Because the ``_id`` key is
- not part of the shard key, the collection could have a document
- with ``_id`` value ``1`` in shard A and another document with
- ``_id`` value ``1`` in shard B.
+ For example, consider a sharded collection (with shard key ``{x:
+ 1}``) that spans two shards A and B. Because the ``_id`` key is
+ not part of the shard key, the collection could have a document
+ with ``_id`` value ``1`` in shard A and another document with
+ ``_id`` value ``1`` in shard B.
- If the ``_id`` field is not the shard key nor the prefix of the
- shard key, MongoDB expects applications to enforce the uniqueness
- of the ``_id`` values across the shards.
+ If the ``_id`` field is not the shard key nor the prefix of the
+ shard key, MongoDB expects applications to enforce the uniqueness
+ of the ``_id`` values across the shards.
- The unique index constraints mean that:
+The unique index constraints mean that:
- - For a to-be-sharded collection, you cannot shard the collection if
- the collection has other unique indexes.
+- For a to-be-sharded collection, you cannot shard the collection if
+ the collection has other unique indexes.
- - For an already-sharded collection, you cannot create unique indexes
- on other fields.
+- For an already-sharded collection, you cannot create unique indexes
+ on other fields.
- - A unique index stores a null value for a document missing the
- indexed field; that is a missing index field is treated as another
- instance of a ``null`` index key value. For more information, see
- :ref:`unique-index-and-missing-field`.
+- A unique index stores a null value for a document missing the
+ indexed field; that is a missing index field is treated as another
+ instance of a ``null`` index key value. For more information, see
+ :ref:`unique-index-and-missing-field`.
- To enforce uniqueness on the shard key values, pass the ``unique``
- parameter as ``true`` to the :method:`sh.shardCollection()` method:
+To enforce uniqueness on the shard key values, pass the ``unique``
+parameter as ``true`` to the :method:`sh.shardCollection()` method:
- .. include:: /includes/extracts/shard-collection-unique-restriction-method.rst
+.. include:: /includes/extracts/shard-collection-unique-restriction-method.rst
You cannot specify a unique constraint on a :ref:`hashed index
`.
-.. index:: shard key; cardinality
+
.. _shard-key-selection-divisible:
.. _sharding-internals-operations-and-reliability:
@@ -417,28 +411,26 @@ missing the shard key fields.
Chunk Range and Missing Shard Key Fields
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. container::
+Missing shard keys fall within the same chunk range as shard keys with
+null values. For example, if the shard key is on the fields ``{ x: 1, y: 1
+}``, then:
- Missing shard keys fall within the same chunk range as shard keys with
- null values. For example, if the shard key is on the fields ``{ x: 1, y: 1
- }``, then:
+.. list-table::
+ :header-rows: 1
+ :widths: 60 60
- .. list-table::
- :header-rows: 1
- :widths: 60 60
+ * - Document Missing Shard Key
- * - Document Missing Shard Key
+ - Falls into Same Range As
- - Falls into Same Range As
-
- * - ``{ x: "hello" }``
- - ``{ x: "hello", y: null }``
+ * - ``{ x: "hello" }``
+ - ``{ x: "hello", y: null }``
- * - ``{ y: "goodbye" }``
- - ``{ x: null, y: "goodbye" }``
+ * - ``{ y: "goodbye" }``
+ - ``{ x: null, y: "goodbye" }``
- * - ``{ z: "oops" }``
- - ``{ x: null, y: null }``
+ * - ``{ z: "oops" }``
+ - ``{ x: null, y: null }``
.. _shard-key-missing-read-write-ops:
diff --git a/source/core/shell-types.txt b/source/core/shell-types.txt
index 2d8a2e29a10..573fa044e42 100644
--- a/source/core/shell-types.txt
+++ b/source/core/shell-types.txt
@@ -13,7 +13,7 @@ Data Types in the ``mongo`` Shell
.. include:: /includes/fact-mongosh-callout.rst
MongoDB :term:`BSON` provides support for additional data types than
-:term:`JSON`. :ecosystem:`Drivers ` provide native
+:term:`JSON`. :driver:`Drivers >` provide native
support for these data types in host languages and the
:binary:`~bin.mongo` shell also provides several helper classes to support
the use of these data types in the :binary:`~bin.mongo` JavaScript
@@ -126,7 +126,9 @@ the following operation in the :binary:`~bin.mongo` shell:
new ObjectId
-.. see:: :method:`ObjectId`
+.. see::
+
+ :method:`ObjectId`
.. _shell-type-long:
@@ -276,8 +278,10 @@ The value is stored in the database as follows:
NumberDecimal("9999999.50000000")
-.. note:: To use the ``decimal`` data type with a
- :ecosystem:`MongoDB driver `, be sure to use a driver
+.. note::
+
+ To use the ``decimal`` data type with a
+ :driver:`MongoDB driver >`, be sure to use a driver
version that supports it.
Equality and Sort Order
diff --git a/source/core/tailable-cursors.txt b/source/core/tailable-cursors.txt
index fba959cc546..496fbab6ebe 100644
--- a/source/core/tailable-cursors.txt
+++ b/source/core/tailable-cursors.txt
@@ -50,5 +50,5 @@ Consider the following behaviors related to tailable cursors:
A *dead* cursor has an id of ``0``.
-See your :ecosystem:`driver documentation ` for the
+See your :driver:`driver documentation >` for the
driver-specific method to specify the tailable cursor.
diff --git a/source/core/text-search-operators.txt b/source/core/text-search-operators.txt
index 89c99b6ad96..6f9ce0bea86 100644
--- a/source/core/text-search-operators.txt
+++ b/source/core/text-search-operators.txt
@@ -19,7 +19,7 @@ Query Framework
.. include:: /includes/fact-use-text-operator.rst
-Use the :projection:`$meta` query operator to obtain and sort by the
+Use the :expression:`$meta` query operator to obtain and sort by the
relevance score of each matching document. For example, to order a
list of coffee shops in order of relevance, run the following:
@@ -30,14 +30,14 @@ list of coffee shops in order of relevance, run the following:
{ score: { $meta: "textScore" } }
).sort( { score: { $meta: "textScore" } } )
-For more information on the :query:`$text` and :projection:`$meta`
+For more information on the :query:`$text` and :expression:`$meta`
operators, including restrictions and behavior, see:
- :query:`$text Reference Page <$text>`
- :ref:`$text Query Examples `
-- :projection:`$meta` projection operator
+- :expression:`$meta` projection operator
Aggregation Framework
diff --git a/source/core/transactions-in-applications.txt b/source/core/transactions-in-applications.txt
index 45290dffc45..733bdd8d426 100644
--- a/source/core/transactions-in-applications.txt
+++ b/source/core/transactions-in-applications.txt
@@ -7,8 +7,7 @@ Drivers API
.. default-domain:: mongodb
-.. role:: red(strong)
- :class: text-danger
+
.. contents:: On this page
:local:
@@ -51,199 +50,107 @@ The new callback API incorporates logic:
- To retry the commit operation if the commit encounters an
:ref:`unknown-transaction-commit-result`.
-.. container::
+.. tabs-pillstrip:: languages
- .. tabs-pillstrip:: languages
+.. tabs-drivers::
- .. tabs-drivers::
+ tabs:
- tabs:
+ - id: python
+ content: |
- - id: python
- content: |
+ .. include:: /includes/extracts/transactions-example-note.rst
- .. include:: /includes/extracts/transactions-example-note.rst
+ The example uses the new callback API for working with
+ transactions, which starts a transaction, executes the
+ specified operations, and commits (or aborts on error). The
+ new callback API incorporates retry logic for
+ :ref:`transient-transaction-error` or
+ :ref:`unknown-transaction-commit-result` commit errors.
- The example uses the new callback API for working with
- transactions, which starts a transaction, executes the
- specified operations, and commits (or aborts on error). The
- new callback API incorporates retry logic for
- :ref:`transient-transaction-error` or
- :ref:`unknown-transaction-commit-result` commit errors.
+ .. literalinclude:: /driver-examples/test_examples.py
+ :language: python
+ :dedent: 8
+ :start-after: Start Transactions withTxn API Example 1
+ :end-before: End Transactions withTxn API Example 1
+
+ - id: java-sync
+ content: |
+
+ .. include:: /includes/extracts/transactions-example-note.rst
+
+ The example uses the new callback API for working with
+ transactions, which starts a transaction, executes the
+ specified operations, and commits (or aborts on error). The
+ new callback API incorporates retry logic for
+ :ref:`transient-transaction-error` or
+ :ref:`unknown-transaction-commit-result` commit errors.
- .. literalinclude:: /driver-examples/test_examples.py
- :language: python
- :dedent: 8
- :start-after: Start Transactions withTxn API Example 1
- :end-before: End Transactions withTxn API Example 1
+ .. code-block:: java
- - id: java-sync
- content: |
+ /*
+ For a replica set, include the replica set name and a seedlist of the members in the URI string; e.g.
+ String uri = "mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017/admin?replicaSet=myRepl";
+ For a sharded cluster, connect to the mongos instances; e.g.
+ String uri = "mongodb://mongos0.example.com:27017,mongos1.example.com:27017:27017/admin";
+ */
- .. include:: /includes/extracts/transactions-example-note.rst
+ final MongoClient client = MongoClients.create(uri);
- The example uses the new callback API for working with
- transactions, which starts a transaction, executes the
- specified operations, and commits (or aborts on error). The
- new callback API incorporates retry logic for
- :ref:`transient-transaction-error` or
- :ref:`unknown-transaction-commit-result` commit errors.
+ /*
+ Create collections.
+ */
- .. code-block:: java
+ client.getDatabase("mydb1").getCollection("foo")
+ .withWriteConcern(WriteConcern.MAJORITY).insertOne( new Document("abc", 0));
+ client.getDatabase("mydb2").getCollection("bar")
+ .withWriteConcern(WriteConcern.MAJORITY).insertOne( new Document("xyz", 0));
- /*
- For a replica set, include the replica set name and a seedlist of the members in the URI string; e.g.
- String uri = "mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017/admin?replicaSet=myRepl";
- For a sharded cluster, connect to the mongos instances; e.g.
- String uri = "mongodb://mongos0.example.com:27017,mongos1.example.com:27017:27017/admin";
- */
-
- final MongoClient client = MongoClients.create(uri);
+ /* Step 1: Start a client session. */
- /*
- Create collections.
- */
-
- client.getDatabase("mydb1").getCollection("foo")
- .withWriteConcern(WriteConcern.MAJORITY).insertOne( new Document("abc", 0));
- client.getDatabase("mydb2").getCollection("bar")
- .withWriteConcern(WriteConcern.MAJORITY).insertOne( new Document("xyz", 0));
+ final ClientSession clientSession = client.startSession();
- /* Step 1: Start a client session. */
+ /* Step 2: Optional. Define options to use for the transaction. */
- final ClientSession clientSession = client.startSession();
+ TransactionOptions txnOptions = TransactionOptions.builder()
+ .readPreference(ReadPreference.primary())
+ .readConcern(ReadConcern.LOCAL)
+ .writeConcern(WriteConcern.MAJORITY)
+ .build();
- /* Step 2: Optional. Define options to use for the transaction. */
+ /* Step 3: Define the sequence of operations to perform inside the transactions. */
- TransactionOptions txnOptions = TransactionOptions.builder()
- .readPreference(ReadPreference.primary())
- .readConcern(ReadConcern.LOCAL)
- .writeConcern(WriteConcern.MAJORITY)
- .build();
+ TransactionBody txnBody = new TransactionBody() {
+ public String execute() {
+ MongoCollection coll1 = client.getDatabase("mydb1").getCollection("foo");
+ MongoCollection coll2 = client.getDatabase("mydb2").getCollection("bar");
- /* Step 3: Define the sequence of operations to perform inside the transactions. */
+ /*
+ Important:: You must pass the session to the operations..
+ */
- TransactionBody txnBody = new TransactionBody() {
- public String execute() {
- MongoCollection coll1 = client.getDatabase("mydb1").getCollection("foo");
- MongoCollection coll2 = client.getDatabase("mydb2").getCollection("bar");
+ coll1.insertOne(clientSession, new Document("abc", 1));
+ coll2.insertOne(clientSession, new Document("xyz", 999));
- /*
- Important:: You must pass the session to the operations..
- */
+ return "Inserted into collections in different databases";
+ }
+ };
+ try {
+ /*
+ Step 4: Use .withTransaction() to start a transaction,
+ execute the callback, and commit (or abort on error).
+ */
+
+ clientSession.withTransaction(txnBody, txnOptions);
+ } catch (RuntimeException e) {
+ // some error handling
+ } finally {
+ clientSession.close();
+ }
- coll1.insertOne(clientSession, new Document("abc", 1));
- coll2.insertOne(clientSession, new Document("xyz", 999));
+ - id: nodejs
+ content: |
- return "Inserted into collections in different databases";
- }
- };
- try {
- /*
- Step 4: Use .withTransaction() to start a transaction,
- execute the callback, and commit (or abort on error).
- */
-
- clientSession.withTransaction(txnBody, txnOptions);
- } catch (RuntimeException e) {
- // some error handling
- } finally {
- clientSession.close();
- }
-
- - id: nodejs
- content: |
-
- .. include:: /includes/extracts/transactions-example-note.rst
-
- The example uses the new callback API for working with
- transactions, which starts a transaction, executes the
- specified operations, and commits (or aborts on error). The
- new callback API incorporates retry logic for
- :ref:`transient-transaction-error` or
- :ref:`unknown-transaction-commit-result` commit errors.
-
- .. literalinclude:: /driver-examples/node_transactions.js
- :language: javascript
- :dedent: 4
- :start-after: Start Transactions withTxn API Example 1
- :end-before: End Transactions withTxn API Example 1
-
- - id: php
- content: |
-
- .. include:: /includes/extracts/transactions-example-note.rst
-
- The example uses the new callback API for working with
- transactions, which starts a transaction, executes the
- specified operations, and commits (or aborts on error). The
- new callback API incorporates retry logic for
- :ref:`transient-transaction-error` or
- :ref:`unknown-transaction-commit-result` commit errors.
-
- .. literalinclude:: /driver-examples/DocumentationExamplesTest.php
- :language: php
- :dedent: 8
- :start-after: Start Transactions withTxn API Example 1
- :end-before: End Transactions withTxn API Example 1
-
- - id: csharp
- content: |
-
- .. include:: /includes/extracts/transactions-example-note.rst
-
- The example uses the new callback API for working with
- transactions, which starts a transaction, executes the
- specified operations, and commits (or aborts on error). The
- new callback API incorporates retry logic for
- :ref:`transient-transaction-error` or
- :ref:`unknown-transaction-commit-result` commit errors.
-
- .. literalinclude:: /driver-examples/withTxnExample1.cs
- :language: c#
- :dedent: 12
- :start-after: Start Transactions withTxn API Example 1
- :end-before: End Transactions withTxn API Example 1
-
-
- - id: c
- content: |
-
- .. include:: /includes/extracts/transactions-example-note.rst
-
- The example uses the new callback API for working with
- transactions, which starts a transaction, executes the
- specified operations, and commits (or aborts on error). The
- new callback API incorporates retry logic for
- :ref:`transient-transaction-error` or
- :ref:`unknown-transaction-commit-result` commit errors.
-
- .. literalinclude:: /driver-examples/test-mongoc-sample-commands.c
- :language: c
- :start-after: Start Transactions withTxn API Example 1
- :end-before: End Transactions withTxn API Example 1
-
- - id: cpp
- content: |
-
- .. include:: /includes/extracts/transactions-example-note.rst
-
- The example uses the new callback API for working with
- transactions, which starts a transaction, executes the
- specified operations, and commits (or aborts on error). The
- new callback API incorporates retry logic for
- :ref:`transient-transaction-error` or
- :ref:`unknown-transaction-commit-result` commit errors.
-
- .. literalinclude:: /driver-examples/cpp-with-transaction.cpp
- :language: cpp
- :dedent: 4
- :start-after: Start Transactions withTxn API Example 1
- :end-before: End Transactions withTxn API Example 1
-
- - id: motor
- content: |
-
.. include:: /includes/extracts/transactions-example-note.rst
The example uses the new callback API for working with
@@ -253,14 +160,14 @@ The new callback API incorporates logic:
:ref:`transient-transaction-error` or
:ref:`unknown-transaction-commit-result` commit errors.
- .. literalinclude:: /driver-examples/test_examples_motor.py
- :language: python
- :dedent: 8
+ .. literalinclude:: /driver-examples/node_transactions.js
+ :language: javascript
+ :dedent: 4
:start-after: Start Transactions withTxn API Example 1
:end-before: End Transactions withTxn API Example 1
- - id: ruby
- content: |
+ - id: php
+ content: |
.. include:: /includes/extracts/transactions-example-note.rst
@@ -271,15 +178,35 @@ The new callback API incorporates logic:
:ref:`transient-transaction-error` or
:ref:`unknown-transaction-commit-result` commit errors.
+ .. literalinclude:: /driver-examples/DocumentationExamplesTest.php
+ :language: php
+ :dedent: 8
+ :start-after: Start Transactions withTxn API Example 1
+ :end-before: End Transactions withTxn API Example 1
- .. literalinclude:: /driver-examples/with_transactions_examples_spec.rb
- :language: ruby
- :dedent: 4
+ - id: csharp
+ content: |
+
+ .. include:: /includes/extracts/transactions-example-note.rst
+
+ The example uses the new callback API for working with
+ transactions, which starts a transaction, executes the
+ specified operations, and commits (or aborts on error). The
+ new callback API incorporates retry logic for
+ :ref:`transient-transaction-error` or
+ :ref:`unknown-transaction-commit-result` commit errors.
+
+ .. literalinclude:: /driver-examples/withTxnExample1.cs
+ :language: c#
+ :dedent: 12
:start-after: Start Transactions withTxn API Example 1
:end-before: End Transactions withTxn API Example 1
- - id: go
- content: |
+
+ - id: c
+ content: |
+
+ .. include:: /includes/extracts/transactions-example-note.rst
The example uses the new callback API for working with
transactions, which starts a transaction, executes the
@@ -288,26 +215,96 @@ The new callback API incorporates logic:
:ref:`transient-transaction-error` or
:ref:`unknown-transaction-commit-result` commit errors.
+ .. literalinclude:: /driver-examples/test-mongoc-sample-commands.c
+ :language: c
+ :start-after: Start Transactions withTxn API Example 1
+ :end-before: End Transactions withTxn API Example 1
+
+ - id: cpp
+ content: |
+
.. include:: /includes/extracts/transactions-example-note.rst
- .. literalinclude:: /driver-examples/go_examples.go
- :language: go
+ The example uses the new callback API for working with
+ transactions, which starts a transaction, executes the
+ specified operations, and commits (or aborts on error). The
+ new callback API incorporates retry logic for
+ :ref:`transient-transaction-error` or
+ :ref:`unknown-transaction-commit-result` commit errors.
+
+ .. literalinclude:: /driver-examples/cpp-with-transaction.cpp
+ :language: cpp
+ :dedent: 4
:start-after: Start Transactions withTxn API Example 1
:end-before: End Transactions withTxn API Example 1
- - id: perl
- content: |
+ - id: motor
+ content: |
+
+ .. include:: /includes/extracts/transactions-example-note.rst
+
+ The example uses the new callback API for working with
+ transactions, which starts a transaction, executes the
+ specified operations, and commits (or aborts on error). The
+ new callback API incorporates retry logic for
+ :ref:`transient-transaction-error` or
+ :ref:`unknown-transaction-commit-result` commit errors.
+
+ .. literalinclude:: /driver-examples/test_examples_motor.py
+ :language: python
+ :dedent: 8
+ :start-after: Start Transactions withTxn API Example 1
+ :end-before: End Transactions withTxn API Example 1
+
+ - id: ruby
+ content: |
+
+ .. include:: /includes/extracts/transactions-example-note.rst
+
+ The example uses the new callback API for working with
+ transactions, which starts a transaction, executes the
+ specified operations, and commits (or aborts on error). The
+ new callback API incorporates retry logic for
+ :ref:`transient-transaction-error` or
+ :ref:`unknown-transaction-commit-result` commit errors.
- .. note::
-
- For the Perl driver, see the :ref:`txn-core-api` usage example instead.
- - id: scala
- content: |
+ .. literalinclude:: /driver-examples/with_transactions_examples_spec.rb
+ :language: ruby
+ :dedent: 4
+ :start-after: Start Transactions withTxn API Example 1
+ :end-before: End Transactions withTxn API Example 1
- .. note::
-
- For the Scala driver, see the :ref:`txn-core-api` usage example instead.
+ - id: go
+ content: |
+
+ The example uses the new callback API for working with
+ transactions, which starts a transaction, executes the
+ specified operations, and commits (or aborts on error). The
+ new callback API incorporates retry logic for
+ :ref:`transient-transaction-error` or
+ :ref:`unknown-transaction-commit-result` commit errors.
+
+ .. include:: /includes/extracts/transactions-example-note.rst
+
+ .. literalinclude:: /driver-examples/go_examples.go
+ :language: go
+ :start-after: Start Transactions withTxn API Example 1
+ :end-before: End Transactions withTxn API Example 1
+
+ - id: perl
+ content: |
+
+ .. note::
+
+ For the Perl driver, see the :ref:`txn-core-api` usage example instead.
+
+ - id: scala
+ content: |
+
+ .. note::
+
+ For the Scala driver, see the :ref:`txn-core-api` usage example instead.
.. _txn-core-api:
@@ -334,11 +331,9 @@ labeled:
The following example incorporates logic to retry the transaction for
transient errors and retry the commit for unknown commit error:
-.. container::
-
- .. tabs-pillstrip:: languages
+.. tabs-pillstrip:: languages
- .. include:: /includes/driver-examples/driver-example-transactions-retry-3.rst
+.. include:: /includes/driver-examples/driver-example-transactions-retry-3.rst
Driver Versions
---------------
diff --git a/source/core/transactions-operations.txt b/source/core/transactions-operations.txt
index be1f9757b23..4239ded92aa 100644
--- a/source/core/transactions-operations.txt
+++ b/source/core/transactions-operations.txt
@@ -6,8 +6,7 @@ Transactions and Operations
.. default-domain:: mongodb
-.. role:: red(strong)
- :class: text-danger
+
.. contents:: On this page
:local:
@@ -50,18 +49,14 @@ The following read/write operations are allowed in transactions:
Count Operation
~~~~~~~~~~~~~~~
-.. container::
-
- .. include:: /includes/extracts/transactions-count.rst
+.. include:: /includes/extracts/transactions-count.rst
.. _transactions-operations-distinct:
Distinct Operation
~~~~~~~~~~~~~~~~~~
-.. container::
-
- .. include:: /includes/extracts/transactions-distinct.rst
+.. include:: /includes/extracts/transactions-distinct.rst
.. _transactions-operations-ddl:
@@ -173,4 +168,6 @@ Restricted Operations
.. include:: /includes/extracts/transactions-operations-restrictions.rst
-.. seealso:: :ref:`txn-prod-considerations-ddl`
+.. seealso::
+
+ :ref:`txn-prod-considerations-ddl`
diff --git a/source/core/transactions-production-consideration.txt b/source/core/transactions-production-consideration.txt
index 0e3dcbc6e88..4d065e705a1 100644
--- a/source/core/transactions-production-consideration.txt
+++ b/source/core/transactions-production-consideration.txt
@@ -4,8 +4,7 @@ Production Considerations
.. default-domain:: mongodb
-.. role:: red(strong)
- :class: text-danger
+
.. contents:: On this page
:local:
@@ -266,7 +265,9 @@ transactions waiting behind that operation abort. That is, the value of
the time required for the in-progress transaction *and* the pending DDL
operation to complete.
-.. seealso::
+.. seealso::
+
+
- :ref:`transactions-write-conflicts`
@@ -301,7 +302,10 @@ In-progress Transactions and Chunk Migration
.. include:: /includes/extracts/transactions-chunk-migration.rst
-.. seealso:: :serverstatus:`shardingStatistics.countDonorMoveChunkLockTimeout`
+.. seealso::
+
+ :serverstatus:`shardingStatistics.countDonorMoveChunkLockTimeout`
+
.. _transactions-prod-consideration-outside-reads:
@@ -346,5 +350,7 @@ of MongoDB 4.2) will fail and can result in errors, including:
Additional Information
----------------------
-.. seealso:: :doc:`/core/transactions-sharded-clusters`
+.. seealso::
+
+ :doc:`/core/transactions-sharded-clusters`
diff --git a/source/core/transactions-sharded-clusters.txt b/source/core/transactions-sharded-clusters.txt
index ba9b1d8d34d..5f9f2753ae5 100644
--- a/source/core/transactions-sharded-clusters.txt
+++ b/source/core/transactions-sharded-clusters.txt
@@ -146,14 +146,19 @@ Chunk Migrations
.. include:: /includes/extracts/transactions-chunk-migration.rst
-.. seealso:: :serverstatus:`shardingStatistics.countDonorMoveChunkLockTimeout`
+.. seealso::
+
+ :serverstatus:`shardingStatistics.countDonorMoveChunkLockTimeout`
+
Outside Reads During Commit
---------------------------
.. include:: /includes/extracts/transactions-multi-shard-block-external-reads.rst
-.. seealso:: :ref:`transactions-atomicity`
+.. seealso::
+
+ :ref:`transactions-atomicity`
Additional Information
----------------------
diff --git a/source/core/transactions.txt b/source/core/transactions.txt
index 8c1c4e2d3a7..4681492c68d 100644
--- a/source/core/transactions.txt
+++ b/source/core/transactions.txt
@@ -4,8 +4,7 @@ Transactions
.. default-domain:: mongodb
-.. role:: red(strong)
- :class: text-danger
+
.. contents:: On this page
:local:
@@ -35,7 +34,6 @@ Transactions API
The following example highlights the key components
of the transactions API:
-
.. tabs-pillstrip:: languages
.. tabs-drivers::
@@ -357,7 +355,9 @@ Multi-document transactions are atomic (i.e. provide an
.. include:: /includes/extracts/transactions-usage.rst
-.. seealso:: :ref:`transactions-prod-consideration-outside-reads`
+.. seealso::
+
+ :ref:`transactions-prod-consideration-outside-reads`
.. _transactions-operations:
@@ -433,27 +433,25 @@ index to create must be on either:
Restrictions
````````````
-.. container::
+- .. include:: /includes/extracts/transactions-cross-shard-collection-restriction.rst
- - .. include:: /includes/extracts/transactions-cross-shard-collection-restriction.rst
+- For explicit creation of a collection or an index inside a
+ transaction, the transaction read concern level must be
+ :readconcern:`"local"`. Explicit creation is through:
- - For explicit creation of a collection or an index inside a
- transaction, the transaction read concern level must be
- :readconcern:`"local"`. Explicit creation is through:
+ .. list-table::
+ :header-rows: 1
- .. list-table::
- :header-rows: 1
+ * - Command
+ - Method
- * - Command
- - Method
-
- * - :dbcommand:`create`
- - :method:`db.createCollection()`
+ * - :dbcommand:`create`
+ - :method:`db.createCollection()`
- * - :dbcommand:`createIndexes`
+ * - :dbcommand:`createIndexes`
- - | :method:`db.collection.createIndex()`
- | :method:`db.collection.createIndexes()`
+ - | :method:`db.collection.createIndex()`
+ | :method:`db.collection.createIndexes()`
.. seealso::
@@ -464,18 +462,14 @@ Restrictions
Count Operation
~~~~~~~~~~~~~~~
-.. container::
-
- .. include:: /includes/extracts/transactions-count.rst
+.. include:: /includes/extracts/transactions-count.rst
.. _transactions-ops-distinct:
Distinct Operation
~~~~~~~~~~~~~~~~~~
-.. container::
-
- .. include:: /includes/extracts/transactions-distinct.rst
+.. include:: /includes/extracts/transactions-distinct.rst
.. _transactions-ops-info:
@@ -566,57 +560,51 @@ Transactions support the following read concern levels:
``"local"``
```````````
-.. container::
+- Read concern :readconcern:`"local"` returns the most recent data
+ available from the node but can be rolled back.
- - Read concern :readconcern:`"local"` returns the most recent data
- available from the node but can be rolled back.
+- For transactions on sharded cluster, :readconcern:`"local"` read
+ concern cannot guarantee that the data is from the same snapshot
+ view across the shards. If snapshot isolation is required, use
+ :ref:`transactions-read-concern-snapshot` read concern.
- - For transactions on sharded cluster, :readconcern:`"local"` read
- concern cannot guarantee that the data is from the same snapshot
- view across the shards. If snapshot isolation is required, use
- :ref:`transactions-read-concern-snapshot` read concern.
-
- - .. include:: /includes/extracts/transactions-create-collections-read-concern.rst
+- .. include:: /includes/extracts/transactions-create-collections-read-concern.rst
``"majority"``
``````````````
-.. container::
-
- - Read concern :readconcern:`"majority"` returns data that has been
- acknowledged by a majority of the replica set members (i.e. data
- cannot be rolled back) **if** the transaction commits with
- :ref:`write concern "majority" `.
+- Read concern :readconcern:`"majority"` returns data that has been
+ acknowledged by a majority of the replica set members (i.e. data
+ cannot be rolled back) **if** the transaction commits with
+ :ref:`write concern "majority" `.
- - If the transaction does not use :ref:`write concern "majority"
- ` for the commit, the
- :readconcern:`"majority"` read concern provides **no** guarantees that
- read operations read majority-committed data.
+- If the transaction does not use :ref:`write concern "majority"
+ ` for the commit, the
+ :readconcern:`"majority"` read concern provides **no** guarantees that
+ read operations read majority-committed data.
- - For transactions on sharded cluster, :readconcern:`"majority"` read
- concern cannot guarantee that the data is from the same snapshot
- view across the shards. If snapshot isolation is required, use
- :ref:`transactions-read-concern-snapshot` read concern.
+- For transactions on sharded cluster, :readconcern:`"majority"` read
+ concern cannot guarantee that the data is from the same snapshot
+ view across the shards. If snapshot isolation is required, use
+ :ref:`transactions-read-concern-snapshot` read concern.
.. _transactions-read-concern-snapshot:
``"snapshot"``
``````````````
-.. container::
+- Read concern :readconcern:`"snapshot"` returns data from a
+ snapshot of majority committed data **if** the transaction commits
+ with :ref:`write concern "majority" `.
- - Read concern :readconcern:`"snapshot"` returns data from a
- snapshot of majority committed data **if** the transaction commits
- with :ref:`write concern "majority" `.
+- If the transaction does not use :ref:`write concern "majority"
+ ` for the commit, the
+ :readconcern:`"snapshot"` read concern provides **no** guarantee that
+ read operations used a snapshot of majority-committed data.
- - If the transaction does not use :ref:`write concern "majority"
- ` for the commit, the
- :readconcern:`"snapshot"` read concern provides **no** guarantee that
- read operations used a snapshot of majority-committed data.
-
- - For transactions on sharded clusters, the
- :readconcern:`"snapshot"` view of the data **is** synchronized
- across shards.
+- For transactions on sharded clusters, the
+ :readconcern:`"snapshot"` view of the data **is** synchronized
+ across shards.
.. _transactions-write-concern:
@@ -656,47 +644,43 @@ values, including:
``w: 1``
````````
-.. container::
-
- - Write concern :writeconcern:`w: 1 <\>` returns
- acknowledgement after the commit has been applied to the primary.
+- Write concern :writeconcern:`w: 1 <\>` returns
+ acknowledgement after the commit has been applied to the primary.
- .. important::
+ .. important::
- When you commit with :writeconcern:`w: 1 <\>`, your
- transaction can be :doc:`rolled back if there is a failover
- `.
+ When you commit with :writeconcern:`w: 1 <\>`, your
+ transaction can be :doc:`rolled back if there is a failover
+ `.
- - When you commit with :writeconcern:`w: 1 <\>` write
- concern, transaction-level :readconcern:`"majority"` read concern
- provides **no** guarantees that read operations in the transaction
- read majority-committed data.
+- When you commit with :writeconcern:`w: 1 <\>` write
+ concern, transaction-level :readconcern:`"majority"` read concern
+ provides **no** guarantees that read operations in the transaction
+ read majority-committed data.
- - When you commit with :writeconcern:`w: 1 <\>` write
- concern, transaction-level :readconcern:`"snapshot"` read concern
- provides **no** guarantee that read operations in the transaction
- used a snapshot of majority-committed data.
+- When you commit with :writeconcern:`w: 1 <\>` write
+ concern, transaction-level :readconcern:`"snapshot"` read concern
+ provides **no** guarantee that read operations in the transaction
+ used a snapshot of majority-committed data.
``w: "majority"``
`````````````````
-.. container::
-
- - Write concern :writeconcern:`w: "majority" <"majority">` returns
- acknowledgement after the commit has been applied to a majority
- (M) of voting members; i.e. the commit has been applied to the
- primary and (M-1) voting secondaries.
-
- - When you commit with :writeconcern:`w: "majority" <"majority">`
- write concern, transaction-level :readconcern:`"majority"` read
- concern guarantees that operations have read majority-committed
- data. For transactions on sharded clusters, this view of the
- majority-committed data is not synchronized across shards.
-
- - When you commit with :writeconcern:`w: "majority" <"majority">`
- write concern, transaction-level :readconcern:`"snapshot"` read
- concern guarantees that operations have from a synchronized
- snapshot of majority-committed data.
+- Write concern :writeconcern:`w: "majority" <"majority">` returns
+ acknowledgement after the commit has been applied to a majority
+ (M) of voting members; i.e. the commit has been applied to the
+ primary and (M-1) voting secondaries.
+
+- When you commit with :writeconcern:`w: "majority" <"majority">`
+ write concern, transaction-level :readconcern:`"majority"` read
+ concern guarantees that operations have read majority-committed
+ data. For transactions on sharded clusters, this view of the
+ majority-committed data is not synchronized across shards.
+
+- When you commit with :writeconcern:`w: "majority" <"majority">`
+ write concern, transaction-level :readconcern:`"snapshot"` read
+ concern guarantees that operations have from a synchronized
+ snapshot of majority-committed data.
.. note::
diff --git a/source/core/wiredtiger.txt b/source/core/wiredtiger.txt
index c1e182fde43..9018780241b 100644
--- a/source/core/wiredtiger.txt
+++ b/source/core/wiredtiger.txt
@@ -105,7 +105,9 @@ will lose all data modifications prior to the last checkpoint.
.. include:: /includes/wiredtiger-node-nojournal.rst
-.. seealso:: :ref:`Journaling with WiredTiger `
+.. seealso::
+
+ :ref:`Journaling with WiredTiger `
.. _storage-wiredtiger-compression:
diff --git a/source/core/write-operations-atomicity.txt b/source/core/write-operations-atomicity.txt
index 4d76ae2e3e0..52c02352b3f 100644
--- a/source/core/write-operations-atomicity.txt
+++ b/source/core/write-operations-atomicity.txt
@@ -43,4 +43,6 @@ examples of use cases, see :ref:`update() and Unique Index
Another approach is to specify the expected current value of a field in
the query predicate for the write operations.
-.. seealso:: :doc:`/core/read-isolation-consistency-recency`
+.. seealso::
+
+ :doc:`/core/read-isolation-consistency-recency`
diff --git a/source/core/write-performance.txt b/source/core/write-performance.txt
index 254640d2a0f..8e7e96a3dca 100644
--- a/source/core/write-performance.txt
+++ b/source/core/write-performance.txt
@@ -53,7 +53,9 @@ disk readahead and RAID configurations.
Solid state drives (SSDs) can outperform spinning hard disks (HDDs) by
100 times or more for random workloads.
-.. see:: :doc:`/administration/production-notes` for recommendations
+.. see::
+
+ :doc:`/administration/production-notes` for recommendations
regarding additional hardware and configuration options.
Journaling
diff --git a/source/core/zone-sharding.txt b/source/core/zone-sharding.txt
index 1d0284806a0..5b52303042e 100644
--- a/source/core/zone-sharding.txt
+++ b/source/core/zone-sharding.txt
@@ -125,7 +125,10 @@ Initial Chunk Distribution
See :ref:`pre-define-zone-range-hashed-example` for for an example.
-.. seealso:: :method:`sh.balancerCollectionStatus()`
+.. seealso::
+
+ :method:`sh.balancerCollectionStatus()`
+
.. _zone-sharding-balancer:
@@ -156,7 +159,10 @@ that zone.
Once configured, the balancer respects zones during future
:ref:`balancing rounds `.
-.. seealso:: :method:`sh.balancerCollectionStatus()`
+.. seealso::
+
+ :method:`sh.balancerCollectionStatus()`
+
.. _zone-sharding-shard-key:
diff --git a/source/data-center-awareness.txt b/source/data-center-awareness.txt
index ea3a60b31ee..3d162215ab4 100644
--- a/source/data-center-awareness.txt
+++ b/source/data-center-awareness.txt
@@ -25,21 +25,19 @@ The following documents, *found either in this section or other sections
of this manual*, provide information on customizing a deployment for
operation- and location-based separation:
-.. class:: toc
-
- :doc:`/core/workload-isolation`
- MongoDB lets you specify that certain application operations use
- certain :binary:`~bin.mongod` instances.
-
- :doc:`/core/zone-sharding`
- A zone represents one or more ranges of shard key values for a
- sharded collection. MongoDB routes reads and writes for sharded
- data covered by a zone only to shards inside that zone. For use in
- managing data distribution and deployment patterns.
-
- :doc:`/tutorial/manage-shard-zone`
- Administrative tasks related to configuring zones in sharded
- clusters
+:doc:`/core/workload-isolation`
+ MongoDB lets you specify that certain application operations use
+ certain :binary:`~bin.mongod` instances.
+
+:doc:`/core/zone-sharding`
+ A zone represents one or more ranges of shard key values for a
+ sharded collection. MongoDB routes reads and writes for sharded
+ data covered by a zone only to shards inside that zone. For use in
+ managing data distribution and deployment patterns.
+
+:doc:`/tutorial/manage-shard-zone`
+ Administrative tasks related to configuring zones in sharded
+ clusters
diff --git a/source/data-modeling.txt b/source/data-modeling.txt
index aaefa2db145..1470a02088f 100644
--- a/source/data-modeling.txt
+++ b/source/data-modeling.txt
@@ -15,27 +15,25 @@ Data in MongoDB has a *flexible schema*. :term:`Collections
flexibility gives you data-modeling choices to match your application
and its performance requirements.
-.. class:: toc
+:doc:`/core/data-modeling-introduction`
+ An introduction to data modeling in MongoDB.
- :doc:`/core/data-modeling-introduction`
- An introduction to data modeling in MongoDB.
+:doc:`/core/schema-validation`
+ MongoDB provides the capability for schema validation during
+ updates and insertions.
- :doc:`/core/schema-validation`
- MongoDB provides the capability for schema validation during
- updates and insertions.
+:doc:`/core/data-models`
+ The core documentation detailing the decisions you must make when
+ determining a data model, and discussing considerations that
+ should be taken into account.
- :doc:`/core/data-models`
- The core documentation detailing the decisions you must make when
- determining a data model, and discussing considerations that
- should be taken into account.
+:doc:`/applications/data-models`
+ Examples of possible data models that you can use to structure
+ your MongoDB documents.
- :doc:`/applications/data-models`
- Examples of possible data models that you can use to structure
- your MongoDB documents.
-
- :doc:`/reference/data-models`
- Reference material for data modeling for developers of MongoDB
- applications.
+:doc:`/reference/data-models`
+ Reference material for data modeling for developers of MongoDB
+ applications.
.. toctree::
diff --git a/source/faq/concurrency.txt b/source/faq/concurrency.txt
index 37277e6c1b3..18cb9df5fd5 100644
--- a/source/faq/concurrency.txt
+++ b/source/faq/concurrency.txt
@@ -279,7 +279,9 @@ the lock for a very short time:
| :method:`db.createUser()`
-
-.. seealso:: :ref:`faq-concurrency-lock-multiple-dbs`
+.. seealso::
+
+ :ref:`faq-concurrency-lock-multiple-dbs`
.. _faq-concurrency-collection-lock:
diff --git a/source/faq/fundamentals.txt b/source/faq/fundamentals.txt
index 0679c94cb24..1052e4c62ad 100644
--- a/source/faq/fundamentals.txt
+++ b/source/faq/fundamentals.txt
@@ -36,7 +36,9 @@ to records or rows in a relational database table. Each document has
:ref:`one or more fields `; fields are similar to
the columns in a relational database table.
-.. seealso:: :doc:`/reference/sql-comparison`, :doc:`/introduction`
+.. seealso::
+
+ :doc:`/reference/sql-comparison`, :doc:`/introduction`
How do I create a database and a collection?
--------------------------------------------
@@ -117,7 +119,9 @@ download the `MongoDB Application Modernization Guide
practices migration guide, reference schema, and other helpful
resources.
-.. seealso:: :doc:`/reference/sql-comparison`
+.. seealso::
+
+ :doc:`/reference/sql-comparison`
Does MongoDB support transactions?
----------------------------------
@@ -153,7 +157,7 @@ object, not a string. Thus traditional SQL injection attacks are not a
problem. More details and some nuances are covered below.
MongoDB represents queries as :term:`BSON` objects. Typically
-:ecosystem:`client libraries ` provide a convenient,
+:driver:`client libraries >` provide a convenient,
injection free, process to build these objects. Consider the following
C++ example:
diff --git a/source/faq/replica-sets.txt b/source/faq/replica-sets.txt
index 9b3eb24c1de..b2e9389ca54 100644
--- a/source/faq/replica-sets.txt
+++ b/source/faq/replica-sets.txt
@@ -35,7 +35,9 @@ For example, a deployment may maintain a :term:`primary` and :term:`secondary`
in an East-coast data center along with a :term:`secondary` member for disaster
recovery in a West-coast data center.
-.. seealso:: :doc:`/tutorial/deploy-geographically-distributed-replica-set`
+.. seealso::
+
+ :doc:`/tutorial/deploy-geographically-distributed-replica-set`
Can MongoDB replicate over a "noisy" connection?
------------------------------------------------
@@ -48,7 +50,9 @@ administrator intervention. However, if the network connections
among the nodes in the replica set are very slow, it might not be
possible for the members of the node to keep up with the replication.
-.. seealso:: :doc:`/core/replica-set-elections`
+.. seealso::
+
+ :doc:`/core/replica-set-elections`
Why use journaling if replication already provides data redundancy?
-------------------------------------------------------------------
@@ -89,7 +93,9 @@ See the documentation for :doc:`/tutorial/configure-ssl` for more
information. As with all MongoDB components, run arbiters on secure
networks.
-.. see:: The overview of
+.. see::
+
+ The overview of
:ref:`Arbiter Members of Replica Sets
`.
diff --git a/source/faq/sharding.txt b/source/faq/sharding.txt
index dc887dbb4cc..495cab1b5a3 100644
--- a/source/faq/sharding.txt
+++ b/source/faq/sharding.txt
@@ -64,7 +64,9 @@ For details on updating the shard key values, see
Before MongoDB 4.2, a document's shard key field value is immutable.
-.. seealso:: :doc:`/core/sharding-shard-key`
+.. seealso::
+
+ :doc:`/core/sharding-shard-key`
Why are my documents not distributed across the shards?
-------------------------------------------------------
diff --git a/source/faq/storage.txt b/source/faq/storage.txt
index eacc7d7814b..40602f376d6 100644
--- a/source/faq/storage.txt
+++ b/source/faq/storage.txt
@@ -26,7 +26,9 @@ for specific workloads. For example, one storage engine might offer
better performance for read-heavy workloads, and another might support a
higher throughput for write operations.
-.. seealso:: :doc:`/core/storage-engines`
+.. seealso::
+
+ :doc:`/core/storage-engines`
Can you mix storage engines in a replica set?
---------------------------------------------
diff --git a/source/geospatial-queries.txt b/source/geospatial-queries.txt
index 9c7703c0dd7..c23f6a9c052 100644
--- a/source/geospatial-queries.txt
+++ b/source/geospatial-queries.txt
@@ -98,7 +98,7 @@ collections:
.. |geo-operation| replace:: :query:`$near` and :query:`$nearSphere`
You can also query for geospatial data for a sharded cluster using
-:query:`$geoWithin` and :query:`$geoIntersect`.
+:query:`$geoWithin` and :query:`$geoIntersects`.
Covered Queries
~~~~~~~~~~~~~~~
@@ -341,7 +341,7 @@ farthest:
}
)
-The following operation uses the :pipeline:`geoNear` aggregation
+The following operation uses the :pipeline:`$geoNear` aggregation
operation to return documents that match the query filter ``{ category:
"Parks" }``, sorted in order of nearest to farthest to the specified
GeoJSON point:
diff --git a/source/images/agg-pipeline.gif b/source/images/agg-pipeline.gif
new file mode 100644
index 00000000000..beae4e6417d
Binary files /dev/null and b/source/images/agg-pipeline.gif differ
diff --git a/source/includes/3.4-downgrade-path.rst b/source/includes/3.4-downgrade-path.rst
index 0c3dbeeb596..abf24973b8c 100644
--- a/source/includes/3.4-downgrade-path.rst
+++ b/source/includes/3.4-downgrade-path.rst
@@ -1,2 +1 @@
-Once upgraded to 3.4, you cannot downgrade to a 3.2.7 or earlier
-version. You can only downgrade to a 3.2.8 or later version.
+Once upgraded to 3.4, you cannot downgrade to a 3.2.7 or earlier version. You can only downgrade to a 3.2.8 or later version.
diff --git a/source/includes/3.4-upgrade-replacements.rst b/source/includes/3.4-upgrade-replacements.rst
index 5ff70df73b5..1b7f04ff6c3 100644
--- a/source/includes/3.4-upgrade-replacements.rst
+++ b/source/includes/3.4-upgrade-replacements.rst
@@ -5,6 +5,6 @@
.. |olderseries| replace:: 3.0-series
.. |compatibility| replace:: :doc:`/release-notes/3.4-compatibility`
.. |upgradefirst| replace:: :doc:`3.2 `
-.. |downgradepath| replace:: .. include:: /includes/3.4-downgrade-path.rst
+.. |downgradepath| replace:: Once upgraded to 3.4, you cannot downgrade to a 3.2.7 or earlier version. You can only downgrade to a 3.2.8 or later version.
.. |installationdoc| replace:: :v3.4:`3.4 installation instructions `
\ No newline at end of file
diff --git a/source/includes/3.6-upgrade-replacements.rst b/source/includes/3.6-upgrade-replacements.rst
index 013b6cc1e0b..6e7dba61e27 100644
--- a/source/includes/3.6-upgrade-replacements.rst
+++ b/source/includes/3.6-upgrade-replacements.rst
@@ -5,7 +5,7 @@
.. |olderseries| replace:: 3.2-series
.. |compatibility| replace:: :doc:`/release-notes/3.6-compatibility`
.. |upgradefirst| replace:: :ref:`upgrade first to 3.4 <3.4-upgrade>`
-.. |downgradepath| replace:: .. include:: /includes/3.6-downgrade-path.rst
+.. |downgradepath| replace:: Once upgraded to |newversion|, if you need to downgrade, we recommend |downgrading| to the latest patch release of 3.4.
.. |features| replace:: :ref:`features <3.6-compatibility-enabled>`
diff --git a/source/includes/4.0-downgrade-path.rst b/source/includes/4.0-downgrade-path.rst
index 3c5a2ffd359..abf384fb50e 100644
--- a/source/includes/4.0-downgrade-path.rst
+++ b/source/includes/4.0-downgrade-path.rst
@@ -1,2 +1 @@
Once upgraded to |newversion|, if you need to downgrade, we recommend |downgrading| to the latest patch release of |oldversion|.
-
diff --git a/source/includes/4.0-upgrade-replacements.rst b/source/includes/4.0-upgrade-replacements.rst
index 27ebde5c05c..dc12a128666 100644
--- a/source/includes/4.0-upgrade-replacements.rst
+++ b/source/includes/4.0-upgrade-replacements.rst
@@ -5,7 +5,7 @@
.. |olderseries| replace:: 3.4-series
.. |compatibility| replace:: :doc:`/release-notes/4.0-compatibility`
.. |upgradefirst| replace:: :ref:`upgrade first to 3.6 <3.6-upgrade>`
-.. |downgradepath| replace:: .. include:: /includes/4.0-downgrade-path.rst
+.. |downgradepath| replace:: Once upgraded to |newversion|, if you need to downgrade, we recommend |downgrading| to the latest patch release of |oldversion|.
.. |features| replace:: :ref:`features<4.0-compatibility-enabled>`
.. |installationdoc| replace:: :v4.0:`4.0 installation instructions `
diff --git a/source/includes/4.2-upgrade-replacements.rst b/source/includes/4.2-upgrade-replacements.rst
index 5c83d193d1c..6870216bd3a 100644
--- a/source/includes/4.2-upgrade-replacements.rst
+++ b/source/includes/4.2-upgrade-replacements.rst
@@ -5,7 +5,7 @@
.. |olderseries| replace:: 3.6-series
.. |compatibility| replace:: :doc:`/release-notes/4.2-compatibility`
.. |upgradefirst| replace:: :ref:`upgrade first to 4.0 <4.0-upgrade>`
-.. |downgradepath| replace:: .. include:: /includes/downgrade-path.rst
+.. |downgradepath| replace:: Once upgraded to |newversion|, if you need to downgrade, we recommend |downgrading| to the latest patch release of |downgradeversion|.
.. |features| replace:: :ref:`features<4.2-compatibility-enabled>`
.. |downgradeversion| replace:: 4.0
diff --git a/source/includes/4.4-upgrade-replacements.rst b/source/includes/4.4-upgrade-replacements.rst
index ce1c18bade5..fe7cbcb821c 100644
--- a/source/includes/4.4-upgrade-replacements.rst
+++ b/source/includes/4.4-upgrade-replacements.rst
@@ -5,7 +5,8 @@
.. |olderseries| replace:: 4.0-series
.. |compatibility| replace:: :doc:`/release-notes/4.4-compatibility`
.. |upgradefirst| replace:: :ref:`upgrade first to 4.2 <4.2-upgrade>`
-.. |downgradepath| replace:: .. include:: /includes/downgrade-path.rst
+.. |downgradepath| replace:: Once upgraded to |newversion|, if you need to downgrade, we recommend |downgrading| to the latest patch release of |downgradeversion|.
+
.. |features| replace:: :ref:`features<4.4-compatibility-enabled>`
.. |downgradeversion| replace:: 4.2
diff --git a/source/includes/access-change-password.rst b/source/includes/access-change-password.rst
index ddb628cd88d..9002353fc05 100644
--- a/source/includes/access-change-password.rst
+++ b/source/includes/access-change-password.rst
@@ -1,3 +1,3 @@
To modify the password of another user on a database, you must have the
-:authaction:`changeAnyPassword` :ref:`action `
+:authaction:`changePassword` :ref:`action `
on that database.
diff --git a/source/includes/access-mongorestore-collections.rst b/source/includes/access-mongorestore-collections.rst
index eff9db73519..c699da0c5a3 100644
--- a/source/includes/access-mongorestore-collections.rst
+++ b/source/includes/access-mongorestore-collections.rst
@@ -5,27 +5,25 @@ If the backup data includes :data:`system.profile
:option:`--oplogReplay `, you need
additional privileges:
-.. container::
+.. list-table::
+ :widths: 20 80
- .. list-table::
- :widths: 20 80
+ * - ``system.profile``
- * - ``system.profile``
+ - .. include:: /includes/fact-restore-role-system.profile.rst
- - .. include:: /includes/fact-restore-role-system.profile.rst
+ Both the built-in roles :authrole:`dbAdmin` and
+ :authrole:`dbAdminAnyDatabase` provide the additional privileges.
- Both the built-in roles :authrole:`dbAdmin` and
- :authrole:`dbAdminAnyDatabase` provide the additional privileges.
+ * - ``--oplogReplay``
- * - ``--oplogReplay``
+ - To run with :option:`--oplogReplay
+ `, create a
+ :ref:`user-defined role ` that has
+ :authaction:`anyAction` on :ref:`resource-anyresource`.
- - To run with :option:`--oplogReplay
- `, create a
- :ref:`user-defined role ` that has
- :authaction:`anyAction` on :ref:`resource-anyresource`.
-
- Grant only to users who must run :binary:`~bin.mongorestore`
- with :option:`--oplogReplay `.
+ Grant only to users who must run :binary:`~bin.mongorestore`
+ with :option:`--oplogReplay `.
.. COMMENT per the following commit, choosing the anyAction/anyResource
over the __system role.
diff --git a/source/includes/access-update-user.rst b/source/includes/access-update-user.rst
index db9c1cacbe7..19087221968 100644
--- a/source/includes/access-update-user.rst
+++ b/source/includes/access-update-user.rst
@@ -6,5 +6,5 @@ You must have the :authaction:`grantRole` :ref:`action
` on a role's database to add a role to a user.
To change another user's ``pwd`` or ``customData`` field, you must have
-the :authaction:`changeAnyPassword` and :authaction:`changeAnyCustomData`
+the :authaction:`changePassword` and :authaction:`changeCustomData`
:ref:`actions ` respectively on that user's database.
diff --git a/source/includes/admonition-config-db-is-internal.rst b/source/includes/admonition-config-db-is-internal.rst
index df0a7d39f0d..fab27c026b4 100644
--- a/source/includes/admonition-config-db-is-internal.rst
+++ b/source/includes/admonition-config-db-is-internal.rst
@@ -1,5 +1,5 @@
-.. admonition:: Internal MongoDB Metadata
+.. tip:: Internal MongoDB Metadata
- The :data:`config` database is internal: applications and
+ The :ref:`config ` database is internal: applications and
administrators should not modify or depend upon its content in the
course of normal operation.
diff --git a/source/includes/admonition-mac-osx-sierra-restriction.rst b/source/includes/admonition-mac-osx-sierra-restriction.rst
index d99808cac13..ec51c036d91 100644
--- a/source/includes/admonition-mac-osx-sierra-restriction.rst
+++ b/source/includes/admonition-mac-osx-sierra-restriction.rst
@@ -1,4 +1,4 @@
-.. admonition:: macOS Sierra and Go 1.6 Incompatibility
+.. note:: macOS Sierra and Go 1.6 Incompatibility
Users running on macOS Sierra require the 3.2.10 or newer version
of |tool-binary|.
diff --git a/source/includes/admonition-wsl.rst b/source/includes/admonition-wsl.rst
index 61b2371d67b..bebe5e371f5 100644
--- a/source/includes/admonition-wsl.rst
+++ b/source/includes/admonition-wsl.rst
@@ -1,4 +1,4 @@
-.. admonition:: Windows Subsystem for Linux (WSL) - Unsupported
- :class: warning
+.. warning:: Windows Subsystem for Linux (WSL) - Unsupported
+
MongoDB does not support the Windows Subsystem for Linux (WSL).
\ No newline at end of file
diff --git a/source/includes/changelogs/releases/3.2.14.rst b/source/includes/changelogs/releases/3.2.14.rst
index afbbcc30034..8bc222256e4 100644
--- a/source/includes/changelogs/releases/3.2.14.rst
+++ b/source/includes/changelogs/releases/3.2.14.rst
@@ -47,7 +47,7 @@ Internals
- :issue:`SERVER-22582` Wrap assert.soon bodies in try catch in replsettest.js
- :issue:`SERVER-22921` Log network interface ASIO response at log level 2
- :issue:`SERVER-23684` async_stream_test - Expected: !(stream.isOpen())
-- :issue:`SERVER-26452` `renameCollection` should handle write conflicts
+- :issue:`SERVER-26452` ``renameCollection`` should handle write conflicts
- :issue:`SERVER-28109` Configure Mac OS X Builders to use toolchain OpenSSL headers
- :issue:`SERVER-28323` Don't pass JavaScript scopes a function ID number
- :issue:`SERVER-28466` The hang analyzer should not attach to resmoke.py in Evergreen
diff --git a/source/includes/changelogs/releases/3.2.17.rst b/source/includes/changelogs/releases/3.2.17.rst
index d5e0f704e24..3fce6604c4e 100644
--- a/source/includes/changelogs/releases/3.2.17.rst
+++ b/source/includes/changelogs/releases/3.2.17.rst
@@ -14,7 +14,7 @@ Sharding
- :issue:`SERVER-29932` add asserts to mapReduce_inSharded_outSharded.js
- :issue:`SERVER-30333` Segfault in 3.2 when loading chunks with unknown shard
- :issue:`SERVER-30636` RangeDeleter assert failed because of replication lag
-- :issue:`SERVER-31111` Add `assert.commandWorked` to migrateBig_balancer.js
+- :issue:`SERVER-31111` Add ``assert.commandWorked`` to migrateBig_balancer.js
Replication
~~~~~~~~~~~
diff --git a/source/includes/changelogs/releases/3.4.10.rst b/source/includes/changelogs/releases/3.4.10.rst
index 361aa565f0f..5a14c3f387d 100644
--- a/source/includes/changelogs/releases/3.4.10.rst
+++ b/source/includes/changelogs/releases/3.4.10.rst
@@ -16,8 +16,8 @@ Sharding
- :issue:`SERVER-30825` blacklist shard_existing_coll_chunk_count.js from the continuous config stepdown suite
- :issue:`SERVER-31049` View with collation doesn't work as expected in sharded cluster
- :issue:`SERVER-31091` The config server balancer stop command does not obey maxTimeMS
-- :issue:`SERVER-31111` Add `assert.commandWorked` to migrateBig_balancer.js
-- :issue:`SERVER-31204` Calling `shardCollection` after `enableSharding` may fail if executed against different mongos
+- :issue:`SERVER-31111` Add ``assert.commandWorked`` to migrateBig_balancer.js
+- :issue:`SERVER-31204` Calling ``shardCollection`` after ``enableSharding`` may fail if executed against different mongos
Replication
~~~~~~~~~~~
diff --git a/source/includes/changelogs/releases/3.4.11.rst b/source/includes/changelogs/releases/3.4.11.rst
index 32c067bf3d6..c122c69c3bc 100644
--- a/source/includes/changelogs/releases/3.4.11.rst
+++ b/source/includes/changelogs/releases/3.4.11.rst
@@ -109,7 +109,7 @@ Internals
- :issue:`SERVER-31670` Change replica set fixture used by replica_sets_jscore_passthrough to make its secondary have zero votes
- :issue:`SERVER-31717` Force C locale on Ubuntu 16.04 builders
- :issue:`SERVER-31818` Add server parameter to disable MarkThread{temporary}Idle
-- :issue:`SERVER-31827` Make `multi_rs.js` wait for secondary status after stepdown in `upgradePrimary`
+- :issue:`SERVER-31827` Make ``multi_rs.js`` wait for secondary status after stepdown in ``upgradePrimary``
- :issue:`SERVER-31957` Remove the timeseries support from etc/system_perf.yml
- :issue:`SERVER-31997` Add additional unittesting for CompatibleFirst policy
- :issue:`SERVER-32044` Use parameterized branch_name in performance projects
diff --git a/source/includes/changelogs/releases/3.4.12.rst b/source/includes/changelogs/releases/3.4.12.rst
index 3d3075433b7..4d991262432 100644
--- a/source/includes/changelogs/releases/3.4.12.rst
+++ b/source/includes/changelogs/releases/3.4.12.rst
@@ -21,7 +21,7 @@ Storage
Operations
~~~~~~~~~~
-- :issue:`SERVER-31437` Fix parsing of `mongo host/db` connect string
+- :issue:`SERVER-31437` Fix parsing of ``mongo host/db`` connect string
- :issue:`SERVER-32875` Don't stall ftdc due to running out of tickets
Build and Packaging
diff --git a/source/includes/changelogs/releases/3.4.14.rst b/source/includes/changelogs/releases/3.4.14.rst
index 02e8b79d056..e034b14c33e 100644
--- a/source/includes/changelogs/releases/3.4.14.rst
+++ b/source/includes/changelogs/releases/3.4.14.rst
@@ -12,9 +12,9 @@ Sharding
~~~~~~~~
- :issue:`SERVER-29812` RangeDeleter unnecessarily waits for 'majority' write concern
-- :issue:`SERVER-31979` Chunk migration statistics are not recorded in the `moveChunk.commit` changelog entries
+- :issue:`SERVER-31979` Chunk migration statistics are not recorded in the ``moveChunk.commit`` changelog entries
- :issue:`SERVER-32886` Unnecessary sleeps during chunk migration
-- :issue:`SERVER-33228` Remove the half-implemented and unused `CollectionRangeDeleter` from the 3.4 codebase
+- :issue:`SERVER-33228` Remove the half-implemented and unused ``CollectionRangeDeleter`` from the 3.4 codebase
Replication
~~~~~~~~~~~
@@ -42,7 +42,7 @@ Operations
~~~~~~~~~~
- :issue:`SERVER-30114` Monitor cumulative time spent in tcmalloc spin lock
-- :issue:`SERVER-33227` Using the method `connect` in a script will as a side effect update global `db`.
+- :issue:`SERVER-33227` Using the method ``connect`` in a script will as a side effect update global ``db``.
Build and Packaging
~~~~~~~~~~~~~~~~~~~
diff --git a/source/includes/changelogs/releases/3.4.16.rst b/source/includes/changelogs/releases/3.4.16.rst
index 7bee7ba3230..253c9e043ed 100644
--- a/source/includes/changelogs/releases/3.4.16.rst
+++ b/source/includes/changelogs/releases/3.4.16.rst
@@ -13,7 +13,7 @@ Sharding
- :issue:`SERVER-25746` Store advisoryHostFQDNs data in config.mongos collections
- :issue:`SERVER-30050` top_chunk_autosplit.js should use w: majority when updating balancer settings
-- :issue:`SERVER-34644` Disable `DollarPrefixedFieldName` checks for moveChunk/mergeChunks
+- :issue:`SERVER-34644` Disable ``DollarPrefixedFieldName`` checks for moveChunk/mergeChunks
Replication
~~~~~~~~~~~
diff --git a/source/includes/changelogs/releases/3.4.17.rst b/source/includes/changelogs/releases/3.4.17.rst
index b5b01f99b66..b8be6c7314d 100644
--- a/source/includes/changelogs/releases/3.4.17.rst
+++ b/source/includes/changelogs/releases/3.4.17.rst
@@ -15,7 +15,7 @@ Sharding
- :issue:`SERVER-27725` Use batch insert when migrating chunks
- :issue:`SERVER-29702` add assert.commandWorked() around addShard in shard_insert_getlasterror_w2.js
- :issue:`SERVER-33237` Optimize the Range Deleter speed
-- :issue:`SERVER-34897` Introduce parameter to control whether MongoS should automatically retry failed `find` commands
+- :issue:`SERVER-34897` Introduce parameter to control whether MongoS should automatically retry failed ``find`` commands
- :issue:`SERVER-36132` Invariant that chunk migration is actually reflected in the metadata after successful commit
- :issue:`SERVER-36232` Refresh after chunk migration commit may not see the committed metadata
diff --git a/source/includes/changelogs/releases/3.4.18.rst b/source/includes/changelogs/releases/3.4.18.rst
index 692b20a93c9..d406986c192 100644
--- a/source/includes/changelogs/releases/3.4.18.rst
+++ b/source/includes/changelogs/releases/3.4.18.rst
@@ -59,7 +59,7 @@ Internals
- :issue:`SERVER-37127` Update baseline comparison for sys-perf
- :issue:`SERVER-37130` Add TLS version counting to mongos
- :issue:`SERVER-37367` Notification::waitFor is not interruptible in 3.4
-- :issue:`SERVER-37393` Fix destructor race in `ReplicaSetMonitorManager`
+- :issue:`SERVER-37393` Fix destructor race in ```ReplicaSetMonitorManager```
- :issue:`SERVER-37424` Sys-perf: change v4.0 branch batch time to once a week
- :issue:`SERVER-37425` Longevity tests -- increase batch time to once a year
- :issue:`SERVER-37437` mongo longevity tests failing
diff --git a/source/includes/changelogs/releases/3.4.19.rst b/source/includes/changelogs/releases/3.4.19.rst
index eb3a6dbfa0a..0263c8c6898 100644
--- a/source/includes/changelogs/releases/3.4.19.rst
+++ b/source/includes/changelogs/releases/3.4.19.rst
@@ -8,7 +8,7 @@ Sharding
- :issue:`SERVER-28716` call fsync after setup before calling collStats/dbStats in jstests/sharding/stats.js
- :issue:`SERVER-30768` Primary queries using maxTimeMS cause temporary shard write unavailability if ExceededTimeLimit
-- :issue:`SERVER-32568` The `migration_sets_fromMigrate_flag.js` test is not compatible with sharding continuous stepdown suite
+- :issue:`SERVER-32568` The ``migration_sets_fromMigrate_flag.js`` test is not compatible with sharding continuous stepdown suite
- :issue:`SERVER-37496` The balancer shouldn't register a shutdown task after the process is multithreaded
- :issue:`SERVER-37616` Implement tuneable batch size for the rangedeleter
- :issue:`SERVER-37902` recovering_slaveok.js should assert all writes it makes succeed
diff --git a/source/includes/changelogs/releases/3.4.22.rst b/source/includes/changelogs/releases/3.4.22.rst
index 72726ff8110..da5f8424104 100644
--- a/source/includes/changelogs/releases/3.4.22.rst
+++ b/source/includes/changelogs/releases/3.4.22.rst
@@ -30,7 +30,7 @@ Build and Packaging
- :issue:`SERVER-36043` systemd unit for mongod starts before multi.user target
- :issue:`SERVER-40242` Update banner inclusions for vendored tools
-- :issue:`SERVER-40563` Our init scripts check /proc/[pid]/stat should validate that `(${procname})` is the process' command name.
+- :issue:`SERVER-40563` Our init scripts check /proc/[pid]/stat should validate that ``(${procname})`` is the process' command name.
- :issue:`SERVER-41424` scons should fail early if invoked with wrong Python interpreter
- :issue:`SERVER-41443` Update Enterprise License
- :issue:`SERVER-42089` Platform Support: Remove Enterprise RHEL 6.7 zSeries from 3.4 and 3.6
diff --git a/source/includes/changelogs/releases/3.4.4.rst b/source/includes/changelogs/releases/3.4.4.rst
index 1fe3c00fd8f..93c6ff8d86f 100644
--- a/source/includes/changelogs/releases/3.4.4.rst
+++ b/source/includes/changelogs/releases/3.4.4.rst
@@ -6,7 +6,7 @@
Security
~~~~~~~~
-- :issue:`SERVER-27821` Make `large_role_chain.js` not run on DEBUG systems
+- :issue:`SERVER-27821` Make ``large_role_chain.js`` not run on DEBUG systems
- :issue:`SERVER-28014` When SSL mode is preferSSL, log connections that do not use SSL
Sharding
@@ -129,7 +129,7 @@ Internals
- :issue:`SERVER-28652` Add logging to track egress connection pool size
- :issue:`SERVER-28692` Move shell tarball generation to compile task
- :issue:`SERVER-28748` Set virtual memory ulimit in package smoke testing for mongo shell tests
-- :issue:`SERVER-28823` burn_in_tests.py does not use api server default due to missing `None` check
+- :issue:`SERVER-28823` burn_in_tests.py does not use api server default due to missing ``None`` check
- :issue:`WT-98` Update the current cursor value without a search
- :issue:`WT-2439` Enhance reconciliation page layout
- :issue:`WT-2990` checkpoint load live_open assertion failure
diff --git a/source/includes/changelogs/releases/3.4.7.rst b/source/includes/changelogs/releases/3.4.7.rst
index f45f894ea0f..05ef5e2777c 100644
--- a/source/includes/changelogs/releases/3.4.7.rst
+++ b/source/includes/changelogs/releases/3.4.7.rst
@@ -54,7 +54,7 @@ Tools
Internals
~~~~~~~~~
-- :issue:`SERVER-26452` `renameCollection` should handle write conflicts
+- :issue:`SERVER-26452` ``renameCollection`` should handle write conflicts
- :issue:`SERVER-28046` Increase timeouts in replsets/read_committed_on_secondary.js to 10 minutes
- :issue:`SERVER-28596` Upload hanging or failing tests in compile_all to S3
- :issue:`SERVER-28991` Eliminate having individual threads in resmoke.py for flushing log output to logkeeper
@@ -68,7 +68,7 @@ Internals
- :issue:`SERVER-30415` Exclude new "evergreen" agent binary name from automatic process killing in Evergren
- :issue:`SERVER-30433` Increase Watchdog Test timeouts
- :issue:`TOOLS-1542` dump and export shouldn't count views before running
-- :issue:`TOOLS-1563` windows tests are failing after `use mongodb 3.4 "current" tests`
+- :issue:`TOOLS-1563` windows tests are failing after ``use mongodb 3.4 "current" tests``
- :issue:`TOOLS-1577` update the readme with information about mongoreplay
- :issue:`TOOLS-1713` Move mongoreplay evergreen config .evergreen.yml into common.yml
- :issue:`TOOLS-1743` legacy24 and legacy26 dumprestore tests failing on master
diff --git a/source/includes/changelogs/releases/3.6.1.rst b/source/includes/changelogs/releases/3.6.1.rst
index d05e213be7b..b16a1263a13 100644
--- a/source/includes/changelogs/releases/3.6.1.rst
+++ b/source/includes/changelogs/releases/3.6.1.rst
@@ -94,7 +94,7 @@ Internals
- :issue:`SERVER-32087` Run test stage of sys-perf and mongo-perf failures should lead to red evergreen boxes
- :issue:`SERVER-32105` Require shard servers and config servers to be started with --replSet or 'replSetName'
- :issue:`SERVER-32106` Migration of txn oplog entries can trigger fassert in secondary replication
-- :issue:`SERVER-32164` Shell SRV implementation does not allow `authSource` from TXT records to be used
+- :issue:`SERVER-32164` Shell SRV implementation does not allow ``authSource`` from TXT records to be used
- :issue:`SERVER-32238` Revert erroneous high error codes
- :issue:`TOOLS-1688` Evergreen tests broken in master
- :issue:`TOOLS-1827` Implement Initial DNS Seedlist discovery spec
diff --git a/source/includes/changelogs/releases/3.6.10.rst b/source/includes/changelogs/releases/3.6.10.rst
index df9adc53a83..3de8257e702 100644
--- a/source/includes/changelogs/releases/3.6.10.rst
+++ b/source/includes/changelogs/releases/3.6.10.rst
@@ -12,7 +12,7 @@ Security
Sharding
~~~~~~~~
-- :issue:`SERVER-36965` Ensure setUp writes in `safe_secondary_reads_single_migration_suspend_range_deletion.js` get propagated to the shard secondary
+- :issue:`SERVER-36965` Ensure setUp writes in ``safe_secondary_reads_single_migration_suspend_range_deletion.js`` get propagated to the shard secondary
- :issue:`SERVER-37051` ShardServerCatalogCacheLoader does not check the internal term after reading from the task queue
- :issue:`SERVER-37080` Implement tuneable batch size for chunk migrations
- :issue:`SERVER-37511` Logical session reaper and refresh threads should set up sessions collection immediately
diff --git a/source/includes/changelogs/releases/3.6.11.rst b/source/includes/changelogs/releases/3.6.11.rst
index 71ad180e6d8..994be667cfe 100644
--- a/source/includes/changelogs/releases/3.6.11.rst
+++ b/source/includes/changelogs/releases/3.6.11.rst
@@ -11,7 +11,7 @@ Security
Sharding
~~~~~~~~
-- :issue:`SERVER-9043` Link `flushRouterConfig` on the config server and shards
+- :issue:`SERVER-9043` Link ``flushRouterConfig`` on the config server and shards
- :issue:`SERVER-31156` Admin command to update the chunk metadata for only one collection
- :issue:`SERVER-36863` query_config.js assumes that config.mongos is always present
- :issue:`SERVER-36901` sh.status() "Last reported error:" is actually 5th Latest error message
@@ -57,7 +57,7 @@ Storage
- :issue:`SERVER-35732` Hyphenated database names do not work with dbStats.fsUsedSize / TotalSize
- :issue:`SERVER-38779` Build a mechanism to periodically cleanup old WT sessions from session cache
-- :issue:`SERVER-38801` Cope with large BSON blobs in queryable's `listDirectory` call.
+- :issue:`SERVER-38801` Cope with large BSON blobs in queryable's ``listDirectory`` call.
Operations
~~~~~~~~~~
diff --git a/source/includes/changelogs/releases/3.6.14.rst b/source/includes/changelogs/releases/3.6.14.rst
index a4926e80f7b..0f5f94016a9 100644
--- a/source/includes/changelogs/releases/3.6.14.rst
+++ b/source/includes/changelogs/releases/3.6.14.rst
@@ -55,7 +55,7 @@ Build and Packaging
~~~~~~~~~~~~~~~~~~~
- :issue:`SERVER-36043` systemd unit for mongod starts before multi.user target
-- :issue:`SERVER-40563` Our init scripts check /proc/[pid]/stat should validate that `(${procname})` is the process' command name.
+- :issue:`SERVER-40563` Our init scripts check /proc/[pid]/stat should validate that ``(${procname})`` is the process' command name.
- :issue:`SERVER-41424` scons should fail early if invoked with wrong Python interpreter
- :issue:`SERVER-41443` Update Enterprise License
- :issue:`SERVER-41743` Update MSI inclusions for 3.6
@@ -73,7 +73,7 @@ Internals
- :issue:`SERVER-38141` Incorrect usage of MONGO_CONFIG_HAS_SSL_SET_ECDH_AUTO prevents enabling of elliptic curve auto negotiation
- :issue:`SERVER-39642` Decrement egress counter when scoped connection not returned to the pool
- :issue:`SERVER-40156` Initial implementation of Split Horizon
-- :issue:`SERVER-40643` Add tests for `replSetConfig` and `replSetInitiate` with Split Horizon
+- :issue:`SERVER-40643` Add tests for ``replSetConfig`` and ``replSetInitiate`` with Split Horizon
- :issue:`SERVER-40645` Add tests for SNI/TLS behavior of Split Horizon
- :issue:`SERVER-40923` Remove npm test command from "run jstestfuzz" Evergreen function
- :issue:`SERVER-40924` Add Evergreen task to sanity check fuzzer can parse JavaScript tests
diff --git a/source/includes/changelogs/releases/3.6.3.rst b/source/includes/changelogs/releases/3.6.3.rst
index e20925b8038..37c5a8210bd 100644
--- a/source/includes/changelogs/releases/3.6.3.rst
+++ b/source/includes/changelogs/releases/3.6.3.rst
@@ -20,11 +20,11 @@ Sharding
- :issue:`SERVER-30152` add safe secondary reads targeted tests for mapReduce
- :issue:`SERVER-30671` Don't expect operationTime to not change in causal_consistency_shell_support.js
- :issue:`SERVER-31860` setFCV on a cluster can fail to call setFCV on shards if the config server primary's ShardRegistry is empty
-- :issue:`SERVER-31979` Chunk migration statistics are not recorded in the `moveChunk.commit` changelog entries
+- :issue:`SERVER-31979` Chunk migration statistics are not recorded in the ``moveChunk.commit`` changelog entries
- :issue:`SERVER-32235` Blacklist core/drop3.js test from causally consistent workloadss
- :issue:`SERVER-32368` do not perform UUID check against a shard's config cache in the sharding_csrs_continuous_config_stepdown_WT suite
- :issue:`SERVER-32554` Source shard stepdown while entering critical section can trigger cloner invariant
-- :issue:`SERVER-32568` The `migration_sets_fromMigrate_flag.js` test is not compatible with sharding continuous stepdown suite
+- :issue:`SERVER-32568` The ``migration_sets_fromMigrate_flag.js`` test is not compatible with sharding continuous stepdown suite
- :issue:`SERVER-32569` Introduce uniform way to allow config servers and shard replica sets to start in non-cluster mode
- :issue:`SERVER-32592` Stepdown during migration cleanup can crash the source shard primary
- :issue:`SERVER-32593` CSRS stepdown during migration commit can trigger fassert on source shard primary
@@ -135,7 +135,7 @@ Internals
- :issue:`SERVER-32376` Blacklist tests that manually call startSession in the retryable_writes_jscore_stepdown_passthrough suite
- :issue:`SERVER-32403` Increase remote EC2 expire time to 3 hours
- :issue:`SERVER-32410` Validate User::CredentialData before attempting to perform authentication
-- :issue:`SERVER-32414` Remove stale `stdx::` requirements from lint.
+- :issue:`SERVER-32414` Remove stale ``stdx::`` requirements from lint.
- :issue:`SERVER-32429` black list regex_targeting.js from step down suites
- :issue:`SERVER-32468` Use a 1-node CSRS in non-stepdown sharding passthroughs tests
- :issue:`SERVER-32475` Microbenchmarks on v3.6 use master version of enterprise module
diff --git a/source/includes/changelogs/releases/3.6.4.rst b/source/includes/changelogs/releases/3.6.4.rst
index 24c057c7f31..20fc374eb50 100644
--- a/source/includes/changelogs/releases/3.6.4.rst
+++ b/source/includes/changelogs/releases/3.6.4.rst
@@ -60,7 +60,7 @@ Operations
- :issue:`SERVER-30114` Monitor cumulative time spent in tcmalloc spin lock
- :issue:`SERVER-30567` Break out serviceExecutorTaskStats by task type
- :issue:`SERVER-32498` "desc" field in currentOp output no longer contains the thread name used in log messages
-- :issue:`SERVER-33227` Using the method `connect` in a script will as a side effect update global `db`.
+- :issue:`SERVER-33227` Using the method ``connect`` in a script will as a side effect update global ``db``.
Build and Packaging
~~~~~~~~~~~~~~~~~~~
diff --git a/source/includes/changelogs/releases/3.6.5.rst b/source/includes/changelogs/releases/3.6.5.rst
index 8210a4959b5..bc70b37e927 100644
--- a/source/includes/changelogs/releases/3.6.5.rst
+++ b/source/includes/changelogs/releases/3.6.5.rst
@@ -21,8 +21,8 @@ Sharding
- :issue:`SERVER-34508` Prevent race condition in Migration Destination Manager from swallowing an exception
- :issue:`SERVER-34571` Invariant fails in destructor of MigrationChunkClonerSourceLegacy on shutdown
- :issue:`SERVER-34586` Possible double mutex acquisition in ShardServerCatalogCacheLoader
-- :issue:`SERVER-34644` Disable `DollarPrefixedFieldName` checks for moveChunk/mergeChunks
-- :issue:`SERVER-34683` Downgrade replicaset from 3.6.4 to 3.4.14 fails due to the presence of `config.system.sessions`
+- :issue:`SERVER-34644` Disable ``DollarPrefixedFieldName`` checks for moveChunk/mergeChunks
+- :issue:`SERVER-34683` Downgrade replicaset from 3.6.4 to 3.4.14 fails due to the presence of ``config.system.sessions``
- :issue:`SERVER-34746` Segmentation fault when shard is started with --shardsvr before being added to a shard
Replication
@@ -59,7 +59,7 @@ Aggregation
Storage
~~~~~~~
-- :issue:`SERVER-32989` `repairDatabase` can race with `dropDatabase`.
+- :issue:`SERVER-32989` ``repairDatabase`` can race with ``dropDatabase``.
- :issue:`SERVER-33743` Use all_committed to set lastApplied on primary nodes
- :issue:`SERVER-34091` Oplog visibility rules can cause cappedTruncateAfter to erroneously skip record deletion in WiredTiger
- :issue:`SERVER-34423` collMod interruption may cause invariant failure
diff --git a/source/includes/changelogs/releases/3.6.6.rst b/source/includes/changelogs/releases/3.6.6.rst
index 635aeb7d52f..aed6ac6c8d5 100644
--- a/source/includes/changelogs/releases/3.6.6.rst
+++ b/source/includes/changelogs/releases/3.6.6.rst
@@ -13,14 +13,14 @@ Sharding
~~~~~~~~
- :issue:`SERVER-25746` Store advisoryHostFQDNs data in config.mongos collections
-- :issue:`SERVER-33081` Reset `KeysCollectionManager` during rollback properly
+- :issue:`SERVER-33081` Reset ``KeysCollectionManager`` during rollback properly
- :issue:`SERVER-33327` Session::onMigrateCompletedOnPrimary should not update the lastWriteDate field
- :issue:`SERVER-33538` mapReduce "replace" on a sharded output collection can lead to UUIDCatalog inconsistencies
-- :issue:`SERVER-33639` Concurrent writes against non-existent database can fail due to distlock acquisition timeout at `createDatabase` time
+- :issue:`SERVER-33639` Concurrent writes against non-existent database can fail due to distlock acquisition timeout at ``createDatabase`` time
- :issue:`SERVER-34363` addShard shard registry reload can cause mongos to terminate
-- :issue:`SERVER-34773` The `TransactionReaper` handler classes are not exception-safe
+- :issue:`SERVER-34773` The ``TransactionReaper`` handler classes are not exception-safe
- :issue:`SERVER-34833` Deadlock between the logical sessions' transaction reaper and MMAP V1 durability thread
-- :issue:`SERVER-34857` `sharding_legacy_api_test` is flaky due to reliance on the system clock
+- :issue:`SERVER-34857` ``sharding_legacy_api_test`` is flaky due to reliance on the system clock
- :issue:`SERVER-35006` Do not reset KeysCollectionManager
- :issue:`SERVER-35345` Test that restarted mongoses are able to connect after FCV update
- :issue:`SERVER-35609` Create initial chunk on primaryShard if only writing one chunk
@@ -47,7 +47,7 @@ Replication
- :issue:`SERVER-34758` replSetGetStatus can deadlock with initialSyncer
- :issue:`SERVER-34900` initial sync uses different batch limits from steady state replication
- :issue:`SERVER-35087` "./jstests/replsets/read_concern_uninitated_set.js" and test should be disabled in evergreen for storage engines - ephemeralForTest & mmapv1.
-- :issue:`SERVER-35124` Stepdown suites with MMAP V1 often fail due to `flushing mmaps` taking long time
+- :issue:`SERVER-35124` Stepdown suites with MMAP V1 often fail due to ``flushing mmaps`` taking long time
- :issue:`SERVER-35249` Invariant that we apply to top of oplog on 3.6 replication recovery
- :issue:`SERVER-35256` Do not treat it as an error if the first batch returned by an oplog query comes back empty in master-slave
- :issue:`SERVER-35340` Reduce number of iterations in update_and_bulk_insert.js FSM workload
@@ -172,7 +172,7 @@ Internals
- :issue:`SERVER-35588` powertest.py should call replSetReconfigure command only after successful replSetGetConfig
- :issue:`SERVER-35610` Refine LDAP options parsing
- :issue:`SERVER-35706` Fix race in ctor for LogicalSessionCacheImpl
-- :issue:`SERVER-35834` Fix compile errors in `dns_name_test` on Microsoft compilers
+- :issue:`SERVER-35834` Fix compile errors in ``dns_name_test`` on Microsoft compilers
- :issue:`SERVER-35917` Blacklists tests which use resumeAfter from the sharded collections change streams passthrough
- :issue:`WT-3698` Threads doing eviction can stall indefinitely when timestamps fail to advance
- :issue:`WT-3892` Add timing_stress_for_test option for lookaside cleanup
diff --git a/source/includes/changelogs/releases/3.6.7.rst b/source/includes/changelogs/releases/3.6.7.rst
index 1cd61f23c90..1a5d81e2a24 100644
--- a/source/includes/changelogs/releases/3.6.7.rst
+++ b/source/includes/changelogs/releases/3.6.7.rst
@@ -17,7 +17,7 @@ Sharding
- :issue:`SERVER-33237` Optimize the Range Deleter speed
- :issue:`SERVER-33697` Provide sanity check on number of cached sessions
- :issue:`SERVER-34843` Mongod can return operationTime greater than $clusterTime
-- :issue:`SERVER-34897` Introduce parameter to control whether MongoS should automatically retry failed `find` commands
+- :issue:`SERVER-34897` Introduce parameter to control whether MongoS should automatically retry failed ``find`` commands
- :issue:`SERVER-35377` Operations on new clients get latest in-memory clusterTime as operationTime
- :issue:`SERVER-35658` session migration is too sensitive to replica set primary elections
- :issue:`SERVER-36041` Increase the size of changelog and actionlog
diff --git a/source/includes/changelogs/releases/3.6.9.rst b/source/includes/changelogs/releases/3.6.9.rst
index 55959bbc63b..63d25a86223 100644
--- a/source/includes/changelogs/releases/3.6.9.rst
+++ b/source/includes/changelogs/releases/3.6.9.rst
@@ -14,7 +14,7 @@ Sharding
- :issue:`SERVER-29160` Sharding commonly uses write concern timeouts of 15 seconds and these are timing out in migration related operations and causing BFs
- :issue:`SERVER-31563` Reevaluate not_allowed_on_sharded_collection_cmd.js testing
-- :issue:`SERVER-31892` moveChunk with `waitForDelete` doesn't wait for majority write concern
+- :issue:`SERVER-31892` moveChunk with ``waitForDelete`` doesn't wait for majority write concern
- :issue:`SERVER-35222` Crash on the config server at expired session cleanup
- :issue:`SERVER-35238` Drop the collection after removing the partially written chunks for mapReduce in mongos_manual_intervention_actions.js
- :issue:`SERVER-35763` lastWriteDate field can get out of sync between repl set nodes during migration
@@ -139,7 +139,7 @@ Internals
- :issue:`SERVER-37130` Add TLS version counting to mongos
- :issue:`SERVER-37149` Remove deadlock in ScheduleBeforeStartupTest
- :issue:`SERVER-37353` Handle $slice value of LLONG_MIN gracefully
-- :issue:`SERVER-37393` Fix destructor race in `ReplicaSetMonitorManager`
+- :issue:`SERVER-37393` Fix destructor race in ``ReplicaSetMonitorManager``
- :issue:`SERVER-37410` Add standalone passthrough suites to detect errors in LogicalSessionCache
- :issue:`SERVER-37424` Sys-perf: change v4.0 branch batch time to once a week
- :issue:`SERVER-37425` Longevity tests -- increase batch time to once a year
diff --git a/source/includes/changelogs/releases/4.0.1.rst b/source/includes/changelogs/releases/4.0.1.rst
index edcd046c78d..90fa8492c11 100644
--- a/source/includes/changelogs/releases/4.0.1.rst
+++ b/source/includes/changelogs/releases/4.0.1.rst
@@ -14,7 +14,7 @@ Sharding
- :issue:`SERVER-33237` Optimize the Range Deleter speed
- :issue:`SERVER-33697` Provide sanity check on number of cached sessions
-- :issue:`SERVER-34897` Introduce parameter to control whether MongoS should automatically retry failed `find` commands
+- :issue:`SERVER-34897` Introduce parameter to control whether MongoS should automatically retry failed ``find`` commands
- :issue:`SERVER-35609` Create initial chunk on primaryShard if only writing one chunk
- :issue:`SERVER-35632` Blacklist lagged_config_secondary.js and all_config_servers_blackholed_from_mongos.js from RHEL 6.7 s390x variants
- :issue:`SERVER-35691` Make all code paths returning StaleConfig error go through the StaleConfigInfo serializer
@@ -33,7 +33,7 @@ Replication
- :issue:`SERVER-32088` ChangeStream resumeAfter does not work on sharded collections if not all shards have chunks for the collection
- :issue:`SERVER-34414` Creating a role with buildsIndexes:false node hits an fassert
- :issue:`SERVER-34758` replSetGetStatus can deadlock with initialSyncer
-- :issue:`SERVER-35124` Stepdown suites with MMAP V1 often fail due to `flushing mmaps` taking long time
+- :issue:`SERVER-35124` Stepdown suites with MMAP V1 often fail due to ``flushing mmaps`` taking long time
- :issue:`SERVER-35200` Speed up failure detection in the OplogFetcher during steady state replication
- :issue:`SERVER-35388` Improve misleading error messages for aggregation stages banned in transactions
- :issue:`SERVER-35488` ReplSetTest.waitForState() should ensure node has finished closing connections
@@ -85,9 +85,9 @@ Storage
- :issue:`SERVER-35789` check for index catalog isready mismatch for multi-doc txns
- :issue:`SERVER-35859` Disable rocksdb buildvariant
- :issue:`SERVER-35994` Reduce CPU load in secondary_reads_unique_indexes.js test
-- :issue:`SERVER-36006` `multiInitialSyncApply` should consider setting a read timestamp of `kNoTimestamp`
+- :issue:`SERVER-36006` ``multiInitialSyncApply`` should consider setting a read timestamp of ``kNoTimestamp``
- :issue:`SERVER-36025` RestartCatalogCommand can attempt to reinitialize oplog pointers on standalones
-- :issue:`SERVER-36167` Add pretty printer for WT `flags` members
+- :issue:`SERVER-36167` Add pretty printer for WT ``flags`` members
GridFS
~~~~~~
@@ -153,7 +153,7 @@ Internals
- :issue:`SERVER-35702` Stop running the agg and update fuzzer on macOS
- :issue:`SERVER-35724` Remote EC2 hosts which are not accessible via ssh should fail with system error
- :issue:`SERVER-35727` make the embedded sdk compile task in to a multi-task task group.
-- :issue:`SERVER-35834` Fix compile errors in `dns_name_test` on Microsoft compilers
+- :issue:`SERVER-35834` Fix compile errors in ``dns_name_test`` on Microsoft compilers
- :issue:`SERVER-35850` Update filename suffix to v4.0-latest for nightly builds
- :issue:`SERVER-35858` Error in call BF Suggestion service
- :issue:`SERVER-35908` Shutdown service entry point in mongoed before shutting down embedded
diff --git a/source/includes/changelogs/releases/4.0.11.rst b/source/includes/changelogs/releases/4.0.11.rst
index 10c1c5ae6d2..abf831eecf7 100644
--- a/source/includes/changelogs/releases/4.0.11.rst
+++ b/source/includes/changelogs/releases/4.0.11.rst
@@ -86,7 +86,7 @@ Build and Packaging
- :issue:`SERVER-36043` systemd unit for mongod starts before multi.user target
- :issue:`SERVER-39465` Update master android builds to r19 NDK
- :issue:`SERVER-40133` Create Markdown description of vendored third party libraries
-- :issue:`SERVER-40563` Our init scripts check /proc/[pid]/stat should validate that `(${procname})` is the process' command name.
+- :issue:`SERVER-40563` Our init scripts check /proc/[pid]/stat should validate that ``(${procname})`` is the process' command name.
- :issue:`SERVER-41039` Android and java multiarch builders cannot import yaml during config expansion
- :issue:`SERVER-41302` Lift restriction on publishing embedded SDKs from the 4.2 branch
- :issue:`SERVER-41424` scons should fail early if invoked with wrong Python interpreter
@@ -106,7 +106,7 @@ Internals
- :issue:`SERVER-40052` Shutdown in mongos can trigger BatchWriteOp invariant
- :issue:`SERVER-40156` Initial implementation of Split Horizon
- :issue:`SERVER-40295` Add details to stage_builder.cpp invariant message
-- :issue:`SERVER-40643` Add tests for `replSetConfig` and `replSetInitiate` with Split Horizon
+- :issue:`SERVER-40643` Add tests for ``replSetConfig`` and ``replSetInitiate`` with Split Horizon
- :issue:`SERVER-40645` Add tests for SNI/TLS behavior of Split Horizon
- :issue:`SERVER-40738` Don't try to upload evergreen tarball when doing Android mobile builds
- :issue:`SERVER-40923` Remove npm test command from "run jstestfuzz" Evergreen function
diff --git a/source/includes/changelogs/releases/4.0.2.rst b/source/includes/changelogs/releases/4.0.2.rst
index 6aac5cb74f0..ee9fb2712a8 100644
--- a/source/includes/changelogs/releases/4.0.2.rst
+++ b/source/includes/changelogs/releases/4.0.2.rst
@@ -19,7 +19,7 @@ Sharding
- :issue:`SERVER-35722` Create internal _shardsvrShardCollection command that runs on the primary shard
- :issue:`SERVER-35723` Make the collection critical section into a RAII class
- :issue:`SERVER-35794` Read zone information for a collection during internal shardCollection command
-- :issue:`SERVER-35849` Remove dependency of the write commands on `sharding_runtime_d`
+- :issue:`SERVER-35849` Remove dependency of the write commands on ``sharding_runtime_d``
- :issue:`SERVER-36031` Move logic to create initial chunks and update metadata during shard collection to the primary shard
- :issue:`SERVER-36071` Check shardsvrShardCollection response status
- :issue:`SERVER-36092` Create internal command to create collection on new shard with existing uuid
@@ -112,7 +112,7 @@ Storage
- :issue:`SERVER-35386` Wait for the secondary's majority commit point to advance before pausing batch application in secondary_reads_timestamp_visibility.js
- :issue:`SERVER-35473` Mobile SE: Fix writeConflictRetry loop with map-reduce jstests
- :issue:`SERVER-35845` Add tag to noPassthrough/indexbg2.js
-- :issue:`SERVER-36005` `IndexCatalogEntryImpl::_catalogIsReady` is unsafe to unconditionally call.
+- :issue:`SERVER-36005` ``IndexCatalogEntryImpl::_catalogIsReady`` is unsafe to unconditionally call.
- :issue:`SERVER-36062` Mobile SE: Stop running parallel and concurrent suites on mobile variants
- :issue:`SERVER-36238` replica set startup fails in wt_cache_full.js, initial_sync_wt_cache_full.js, recovery_wt_cache_full.js when journaling is disabled
- :issue:`SERVER-36397` Embedded Server SDK Should Return Error When TTL Index Creation is Attempted
diff --git a/source/includes/changelogs/releases/4.0.3.rst b/source/includes/changelogs/releases/4.0.3.rst
index bc04596ee8d..9b77da58218 100644
--- a/source/includes/changelogs/releases/4.0.3.rst
+++ b/source/includes/changelogs/releases/4.0.3.rst
@@ -71,7 +71,7 @@ Storage
- :issue:`SERVER-34577` read_after_optime.js fails on mongoe
- :issue:`SERVER-34606` Test (and possibly fix) behavior around majority commit point and oplog truncation
- :issue:`SERVER-35657` Do not delay journal flushes when operations are waiting for oplog visibility
-- :issue:`SERVER-35780` `renameCollection` across databases incorrectly timestamps metadata for secondary index builds
+- :issue:`SERVER-35780` ``renameCollection`` across databases incorrectly timestamps metadata for secondary index builds
- :issue:`SERVER-36400` Explicitly destroy the client on exiting the run body of each BackgroundJob
- :issue:`SERVER-36531` Lock acquisition may throw despite presence of UninterruptibleLockGuard when WT tickets are exhausted
- :issue:`SERVER-36879` write regression test for stuck cache issue during rollback
@@ -133,7 +133,7 @@ Internals
- :issue:`SERVER-35696` Provide a way to restore idents known by WiredTiger, but unknown to the _mdb_catalog
- :issue:`SERVER-35731` Prevent a repaired node from re-joining a replica set
- :issue:`SERVER-35782` Repair should move aside unsalvageable data files and create empty ones in their place
-- :issue:`SERVER-35784` Fix ambiguously named test fixture in `commands_test.cpp`
+- :issue:`SERVER-35784` Fix ambiguously named test fixture in ``commands_test.cpp``
- :issue:`SERVER-35800` resmoke.py should retry getting a build_id and test_id from logkeeper
- :issue:`SERVER-35985` sessions_test and sharding_catalog_manager_test don't destroy all Clients before destroying the ServiceContext
- :issue:`SERVER-36019` Create script to collect resource utilization of Android application
@@ -165,7 +165,7 @@ Internals
- :issue:`SERVER-36836` v4.0 fsm workload "yield_group.js" should accept "InternalError" as a possible outcome of the group command
- :issue:`SERVER-36842` Core dump not generated after invariant failure in powercycle hosts
- :issue:`SERVER-36869` fsm capped collection checks should only make 1 query for assertions
-- :issue:`SERVER-36897` OplogReader.hasNext can return false -> true, confusing `checkOplogs`
+- :issue:`SERVER-36897` OplogReader.hasNext can return false -> true, confusing ``checkOplogs``
- :issue:`SERVER-36906` Connection state now allowed to be kConnectionStateUnknown
- :issue:`SERVER-36919` Add server setParameter tlsWithholdClientCertificate (bool)
- :issue:`SERVER-36942` Differentiate invalid hostname from invalid certificate
diff --git a/source/includes/changelogs/releases/4.0.4.rst b/source/includes/changelogs/releases/4.0.4.rst
index 8fe027cabe5..41ad84a7e14 100644
--- a/source/includes/changelogs/releases/4.0.4.rst
+++ b/source/includes/changelogs/releases/4.0.4.rst
@@ -13,7 +13,7 @@ Sharding
- :issue:`SERVER-29160` Sharding commonly uses write concern timeouts of 15 seconds and these are timing out in migration related operations and causing BFs
- :issue:`SERVER-31563` Reevaluate not_allowed_on_sharded_collection_cmd.js testing
-- :issue:`SERVER-31892` moveChunk with `waitForDelete` doesn't wait for majority write concern
+- :issue:`SERVER-31892` moveChunk with ``waitForDelete`` doesn't wait for majority write concern
- :issue:`SERVER-35323` sessionId matching ignores userId part of the lsid
- :issue:`SERVER-35763` lastWriteDate field can get out of sync between repl set nodes during migration
- :issue:`SERVER-36831` LogicalSessionCache on mongos does not correctly report active operations
@@ -112,7 +112,7 @@ Internals
- :issue:`SERVER-37334` Strip .jar and .aar of unnecessary shared objects
- :issue:`SERVER-37353` Handle $slice value of LLONG_MIN gracefully
- :issue:`SERVER-37391` plan_cache_index_create.js should wait for index build start, rather than just createIndexes command start
-- :issue:`SERVER-37393` Fix destructor race in `ReplicaSetMonitorManager`
+- :issue:`SERVER-37393` Fix destructor race in ``ReplicaSetMonitorManager``
- :issue:`SERVER-37410` Add standalone passthrough suites to detect errors in LogicalSessionCache
- :issue:`SERVER-37411` Fix bundle identifiers in embedded Info.plist
- :issue:`SERVER-37424` Sys-perf: change v4.0 branch batch time to once a week
@@ -123,7 +123,7 @@ Internals
- :issue:`SERVER-37495` Change Android minimum API level to 21
- :issue:`SERVER-37513` Pass along JNA exceptions from MongoEmbeddedCAPI.create
- :issue:`SERVER-37561` Server startupWarnings show spurious empty lines
-- :issue:`SERVER-37563` Get rid of `getGlobalAuthorizationManager` and unnecessary references to the `authorization_manager_global` library
+- :issue:`SERVER-37563` Get rid of ``getGlobalAuthorizationManager`` and unnecessary references to the ``authorization_manager_global`` library
- :issue:`SERVER-37583` Changes to etc/cloud_nightly.yml
- :issue:`SERVER-37599` Log exit code of shell-spawned processes
- :issue:`SERVER-37683` Change embedded iOS min version to 11.0 in CocoaPod podspec
diff --git a/source/includes/changelogs/releases/4.0.5.rst b/source/includes/changelogs/releases/4.0.5.rst
index 0cbcf735c8e..1a7f0834693 100644
--- a/source/includes/changelogs/releases/4.0.5.rst
+++ b/source/includes/changelogs/releases/4.0.5.rst
@@ -14,7 +14,7 @@ Sharding
- :issue:`SERVER-30714` Handle step down error in ReplicationCoordinatorExternalStateImpl::_shardingOnTransitionToPrimaryHook
- :issue:`SERVER-36349` Handle the ShardingOperationFailedStatus in the OperationShardingState destructor when the OperationContext is not created in a ServiceEntryPoint
-- :issue:`SERVER-36965` Ensure setUp writes in `safe_secondary_reads_single_migration_suspend_range_deletion.js` get propagated to the shard secondary
+- :issue:`SERVER-36965` Ensure setUp writes in ``safe_secondary_reads_single_migration_suspend_range_deletion.js`` get propagated to the shard secondary
- :issue:`SERVER-36966` Sharded map reduce may fail to clean up temporary output collection
- :issue:`SERVER-37051` ShardServerCatalogCacheLoader does not check the internal term after reading from the task queue
- :issue:`SERVER-37080` Implement tuneable batch size for chunk migrations
diff --git a/source/includes/changelogs/releases/4.0.6.rst b/source/includes/changelogs/releases/4.0.6.rst
index 6b39df806e7..e5af4d6049f 100644
--- a/source/includes/changelogs/releases/4.0.6.rst
+++ b/source/includes/changelogs/releases/4.0.6.rst
@@ -12,7 +12,7 @@ Security
Sharding
~~~~~~~~
-- :issue:`SERVER-9043` Link `flushRouterConfig` on the config server and shards
+- :issue:`SERVER-9043` Link ``flushRouterConfig`` on the config server and shards
- :issue:`SERVER-31156` Admin command to update the chunk metadata for only one collection
- :issue:`SERVER-36863` query_config.js assumes that config.mongos is always present
- :issue:`SERVER-38050` The range deleter doesn't validate it is still operating on the same collection after the deletion loop
diff --git a/source/includes/changelogs/releases/4.0.7.rst b/source/includes/changelogs/releases/4.0.7.rst
index f41d0f37025..25bdadb1e4c 100644
--- a/source/includes/changelogs/releases/4.0.7.rst
+++ b/source/includes/changelogs/releases/4.0.7.rst
@@ -14,14 +14,14 @@ Sharding
~~~~~~~~
- :issue:`SERVER-36901` sh.status() "Last reported error:" is actually 5th Latest error message
-- :issue:`SERVER-36958` Parts of the `_configsvrShardCollection` command do not retry on network errors
-- :issue:`SERVER-37591` MigrationSourceManager is not exception safe before `startClone` completes
+- :issue:`SERVER-36958` Parts of the ``_configsvrShardCollection`` command do not retry on network errors
+- :issue:`SERVER-37591` MigrationSourceManager is not exception safe before ``startClone`` completes
- :issue:`SERVER-38192` Ignore duplicate key error from refreshLogicalSessionCacheNow
- :issue:`SERVER-38205` Optimize splitVector for the jumbo-chunk case
- :issue:`SERVER-38387` agg_out.js concurrency workload always fails to shard the output collection
- :issue:`SERVER-39203` failcommand_ignores_internal.js fails against mongod 3.6
- :issue:`SERVER-39847` Migrating session info can trigger fassert when destination shard has transaction history truncated by oplog
-- :issue:`SERVER-40010` Shard secondaries with 4.0 binary and 3.6 FCV are calling `_flushDatabaseCacheUpdates`
+- :issue:`SERVER-40010` Shard secondaries with 4.0 binary and 3.6 FCV are calling ``_flushDatabaseCacheUpdates``
Replication
~~~~~~~~~~~
@@ -84,7 +84,7 @@ Storage
- :issue:`SERVER-35732` Hyphenated database names do not work with dbStats.fsUsedSize / TotalSize
- :issue:`SERVER-38555` cappedTruncateAfter must not set oldest timestamp during startup recovery when enableMajorityReadConcern=false
- :issue:`SERVER-38745` MigrationDestinationManager assigns incorrect timestamps while building multiple indexes
-- :issue:`SERVER-38801` Cope with large BSON blobs in queryable's `listDirectory` call.
+- :issue:`SERVER-38801` Cope with large BSON blobs in queryable's ``listDirectory`` call.
- :issue:`SERVER-38833` A failure to timestamp a storage transaction requires restarting the transaction
- :issue:`SERVER-39106` GlobalLock acquisition should throw when ticket acquisition times out if there is a max lock timeout and no deadline
- :issue:`SERVER-39259` Mobile SE: Adjust SQLite Pragmas for Improved Performance
diff --git a/source/includes/changelogs/releases/4.2.2.rst b/source/includes/changelogs/releases/4.2.2.rst
index 3b5f9e1a1f4..eea331073ea 100644
--- a/source/includes/changelogs/releases/4.2.2.rst
+++ b/source/includes/changelogs/releases/4.2.2.rst
@@ -82,7 +82,7 @@ Storage
Operations
~~~~~~~~~~
-- :issue:`SERVER-42886` Fix `bypassAutoDecrypt` settings in shell
+- :issue:`SERVER-42886` Fix ``bypassAutoDecrypt`` settings in shell
- :issue:`SERVER-43265` Mongo Shell exits with InvalidOptions error when using URI compressors parameter
- :issue:`SERVER-43884` Improve Error Formatting for mongocryptd-origin errors
diff --git a/source/includes/changelogs/releases/4.2.3.rst b/source/includes/changelogs/releases/4.2.3.rst
index f7f1f09934b..9067ba30408 100644
--- a/source/includes/changelogs/releases/4.2.3.rst
+++ b/source/includes/changelogs/releases/4.2.3.rst
@@ -106,7 +106,7 @@ Internals
- :issue:`SERVER-42697` Expose tcmalloc_release_rate via setParameter
- :issue:`SERVER-43210` jstests/sharding/kill_sessions.js doesn't wait for operation to be killed.
- :issue:`SERVER-43246` Add a log line for when a cursor is reaped due to logical session cleanup
-- :issue:`SERVER-43310` mongos tries to connect to the secondary to create the index if `rs.slaveOk()` is set.
+- :issue:`SERVER-43310` mongos tries to connect to the secondary to create the index if ``rs.slaveOk()`` is set.
- :issue:`SERVER-43324` Add BasicLockableAdaptor for cleaner function APIs
- :issue:`SERVER-43349` Incorrect serialization for $elemMatch $not $ne
- :issue:`SERVER-43623` Stop catching exceptions in NetworkInterfaceASIO
diff --git a/source/includes/changelogs/releases/4.4.2.rst b/source/includes/changelogs/releases/4.4.2.rst
index ad926846c36..ee01124fc15 100644
--- a/source/includes/changelogs/releases/4.4.2.rst
+++ b/source/includes/changelogs/releases/4.4.2.rst
@@ -139,7 +139,7 @@ Build and Packaging
- :issue:`SERVER-50125` UBSAN with ccache doesn't always respect -fsanitize-blacklist options
- :issue:`SERVER-50363` Promote --build-tools=next to stable
- :issue:`SERVER-50648` RHEL 8.2 ARM builder's publish_packages task should not run on an ARM host.
-- :issue:`SERVER-50674` Darwin --separate-debug tool should not strip with the `x` flag
+- :issue:`SERVER-50674` Darwin --separate-debug tool should not strip with the ``x`` flag
Internals
~~~~~~~~~
diff --git a/source/includes/collation-locale-table.rst b/source/includes/collation-locale-table.rst
index 0647d7c80f4..93a7988a913 100644
--- a/source/includes/collation-locale-table.rst
+++ b/source/includes/collation-locale-table.rst
@@ -1,5 +1,4 @@
.. list-table::
- :class: index-table index-table-less-padding
* - .. list-table::
:header-rows: 1
diff --git a/source/includes/considerations-deploying-replica-set.rst b/source/includes/considerations-deploying-replica-set.rst
index 80ec4a68582..5be023f7ece 100644
--- a/source/includes/considerations-deploying-replica-set.rst
+++ b/source/includes/considerations-deploying-replica-set.rst
@@ -14,8 +14,9 @@ Hostnames
IP Binding
~~~~~~~~~~
-Use the :setting:`bind_ip` option to ensure that MongoDB listens for
-connections from applications on configured addresses.
+Use the :option:`--bind_ip ` option to ensure that
+MongoDB listens for connections from applications on configured
+addresses.
.. versionchanged:: 3.6
diff --git a/source/includes/driver-examples/driver-example-delete-55.rst b/source/includes/driver-examples/driver-example-delete-55.rst
index f28f452d4e6..2175bb01330 100644
--- a/source/includes/driver-examples/driver-example-delete-55.rst
+++ b/source/includes/driver-examples/driver-example-delete-55.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.insertMany( [
@@ -14,11 +14,9 @@
{ item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" },
] );
- .. only:: website
-
- You can run the operation in the web shell below:
+ .. include:: /includes/fact-mws-intro.rst
- .. include:: /includes/fact-mws.rst
+ .. include:: /includes/fact-mws.rst
- id: compass
content: |
@@ -43,7 +41,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -52,7 +50,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -61,7 +59,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -70,7 +68,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -79,7 +77,7 @@
- id: nodejs
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/node_remove.js
:language: javascript
:dedent: 4
@@ -88,7 +86,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -97,7 +95,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -106,7 +104,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 6
@@ -115,7 +113,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -124,7 +122,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-delete-56.rst b/source/includes/driver-examples/driver-example-delete-56.rst
index c6c895670be..d1091f2872d 100644
--- a/source/includes/driver-examples/driver-example-delete-56.rst
+++ b/source/includes/driver-examples/driver-example-delete-56.rst
@@ -3,14 +3,14 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.deleteMany({})
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -19,7 +19,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -28,7 +28,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -37,7 +37,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -46,7 +46,7 @@
- id: nodejs
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/node_remove.js
:language: javascript
:dedent: 6
@@ -55,7 +55,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -64,7 +64,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -73,7 +73,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -82,7 +82,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -91,7 +91,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-delete-57.rst b/source/includes/driver-examples/driver-example-delete-57.rst
index 91f290d670e..b4046ed438c 100644
--- a/source/includes/driver-examples/driver-example-delete-57.rst
+++ b/source/includes/driver-examples/driver-example-delete-57.rst
@@ -3,14 +3,14 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.deleteMany({ status : "A" })
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -19,7 +19,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -28,7 +28,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -37,7 +37,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -46,7 +46,7 @@
- id: nodejs
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/node_remove.js
:language: javascript
:dedent: 6
@@ -55,7 +55,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -64,7 +64,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -73,7 +73,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -82,7 +82,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -91,7 +91,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-delete-58.rst b/source/includes/driver-examples/driver-example-delete-58.rst
index 17ba1646a45..04f5f93b9b2 100644
--- a/source/includes/driver-examples/driver-example-delete-58.rst
+++ b/source/includes/driver-examples/driver-example-delete-58.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.deleteOne( { status: "D" } )
@@ -15,10 +15,7 @@
to access the :ref:`Table View `:
.. figure:: /images/compass-table-btn-click-2.png
-
- .. raw:: html
-
-
+ :alt: Compass Table View button
#. Use the Compass :ref:`query bar ` to
locate the target document.
@@ -26,50 +23,32 @@
Copy the following filter document into the query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
.. code-block:: javascript
{ item: "paper" }
.. figure:: /images/compass-delete-paper-find.png
-
- .. raw:: html
-
-
+ :alt: Compass Find button
#. Hover over the document and click the trash icon which
appears on the right-hand side:
- .. raw:: html
-
-
-
.. figure:: /images/compass-delete-button-click.png
-
- .. raw:: html
-
-
+ :alt: Compass Delete Document button
After clicking the delete button, the document is flagged
for deletion and Compass asks for confirmation that you
want to remove the document:
- .. raw:: html
-
-
-
.. figure:: /images/compass-delete-confirm.png
-
- .. raw:: html
-
-
+ :alt: Compass Confirm Deletion button
#. Click :guilabel:`Delete` to confirm. Compass deletes the
document from the collection.
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -78,7 +57,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -87,7 +66,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -96,7 +75,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -105,7 +84,7 @@
- id: nodejs
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/node_remove.js
:language: javascript
:dedent: 6
@@ -114,7 +93,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -123,7 +102,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -132,7 +111,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -141,7 +120,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -150,7 +129,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-indexes-1.rst b/source/includes/driver-examples/driver-example-indexes-1.rst
index 100a20695fd..1661e7cd1d3 100644
--- a/source/includes/driver-examples/driver-example-indexes-1.rst
+++ b/source/includes/driver-examples/driver-example-indexes-1.rst
@@ -7,7 +7,7 @@
:doc:`Mongo Shell `, use
:method:`db.collection.createIndex()`.
- .. class:: copyable-code
+
.. code-block:: javascript
db.collection.createIndex( , )
@@ -15,7 +15,7 @@
The following example creates a single key descending index on
the ``name`` field:
- .. class:: copyable-code
+
.. code-block:: javascript
db.collection.createIndex( { name: -1 } )
@@ -42,7 +42,7 @@
:api:`Python driver `,
use :py:meth:`pymongo.collection.Collection.create_index`.
- .. class:: copyable-code
+
.. code-block:: python
db.collection.create_index([()], )
@@ -50,7 +50,7 @@
The following example creates a single key descending index on
the ``name`` field:
- .. class:: copyable-code
+
.. code-block:: python
collection.create_index([("name", pymongo.DESCENDING)])
@@ -66,7 +66,7 @@
use
:py:meth:`motor.motor_asyncio.AsyncIOMotorCollection.create_index`.
- .. class:: copyable-code
+
.. code-block:: python
await db.collection.create_index([()], )
@@ -74,7 +74,7 @@
The following example creates a single key descending index on
the ``name`` field:
- .. class:: copyable-code
+
.. code-block:: python
await collection.create_index([("name", pymongo.DESCENDING)])
@@ -90,7 +90,7 @@
use
`com.mongodb.client.MongoCollection.createIndex `_.
- .. class:: copyable-code
+
.. code-block:: java
collection.createIndex( , )
@@ -98,7 +98,7 @@
The following example creates a single key descending index on
the ``name`` field:
- .. class:: copyable-code
+
.. code-block:: java
collection.createIndex(Indexes.descending("name"));
@@ -114,7 +114,7 @@
use
`com.mongodb.async.client.MongoCollection.createIndex `_.
- .. class:: copyable-code
+
.. code-block:: java
collection.createIndex( , , )
@@ -122,7 +122,7 @@
The following example creates a single key descending index on
the ``name`` field:
- .. class:: copyable-code
+
.. code-block:: java
collection.createIndex(Indexes.descending("name"), someCallbackFunction());
@@ -138,7 +138,7 @@
use
`createIndex() `_.
- .. class:: copyable-code
+
.. code-block:: javascript
collection.createIndex( { }, function(err, result) {
@@ -149,7 +149,7 @@
The following example creates a single key descending index on
the ``name`` field:
- .. class:: copyable-code
+
.. code-block:: javascript
collection.createIndex( { name : -1 }, function(err, result) {
@@ -167,7 +167,7 @@
`PHP driver `_, use
:phpmethod:`MongoDB\\Collection::createIndex() `.
- .. class:: copyable-code
+
.. code-block:: php
$collection->createIndex(, );
@@ -175,7 +175,7 @@
The following example creates a single key descending index on
the ``name`` field:
- .. class:: copyable-code
+
.. code-block:: php
$collection->createIndex(['name' => -1]);
@@ -191,7 +191,7 @@
use
`create_one() `_.
- .. class:: copyable-code
+
.. code-block:: perl
my $indexes = $db->get_collection( )->indexes;
@@ -200,7 +200,7 @@
The following example creates a single key descending index on
the ``name`` field:
- .. class:: copyable-code
+
.. code-block:: perl
my $indexes = $db->get_collection( )->indexes;
@@ -216,7 +216,7 @@
`Ruby driver `_, use
`Mongo::Index::View#create_one `_.
- .. class:: copyable-code
+
.. code-block:: ruby
client[:collection].indexes.create_one({ }, {options})
@@ -224,7 +224,7 @@
The following example creates a single key descending index on
the ``name`` field:
- .. class:: copyable-code
+
.. code-block:: ruby
client[:collection].indexes.create_one({ name: -1 })
@@ -240,7 +240,7 @@
use
`org.mongodb.scala.model.Indexes `_.
- .. class:: copyable-code
+
.. code-block:: scala
collection.createIndex()
@@ -248,7 +248,7 @@
The following example creates a single key descending index on
the ``name`` field:
- .. class:: copyable-code
+
.. code-block:: scala
collection.createIndex(descending("name"))
@@ -264,7 +264,7 @@
use
`MongoCollection.CreateIndex `_.
- .. class:: copyable-code
+
.. code-block:: csharp
collection.CreateIndex( IndexKeys., );
@@ -272,7 +272,7 @@
The following example creates a single key descending index on
the ``name`` field:
- .. class:: copyable-code
+
.. code-block:: csharp
collection.CreateIndex( IndexKeys.Descending("name") );
diff --git a/source/includes/driver-examples/driver-example-indexes-2.rst b/source/includes/driver-examples/driver-example-indexes-2.rst
index 8208e2f053c..058355dee97 100644
--- a/source/includes/driver-examples/driver-example-indexes-2.rst
+++ b/source/includes/driver-examples/driver-example-indexes-2.rst
@@ -14,8 +14,8 @@
the :doc:`Mongo Shell `.
Refer to the
- :hardlink:`MongoDB Compass Documentation
- ` for instructions on using
+ :compass:`MongoDB Compass Documentation
+ ` for instructions on using
custom collation with indexes in Compass.
diff --git a/source/includes/driver-examples/driver-example-insert-1.rst b/source/includes/driver-examples/driver-example-insert-1.rst
index 30935374506..62f2588a613 100644
--- a/source/includes/driver-examples/driver-example-insert-1.rst
+++ b/source/includes/driver-examples/driver-example-insert-1.rst
@@ -3,26 +3,25 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.insertOne(
{ item: "canvas", qty: 100, tags: ["cotton"], size: { h: 28, w: 35.5, uom: "cm" } }
)
- .. only:: website
-
- You can run the operation in the web shell below:
+ .. include:: /includes/fact-mws-intro.rst
- .. include:: /includes/fact-mws.rst
+ .. include:: /includes/fact-mws.rst
- id: compass
content: |
.. figure:: /images/compass-insert-document-inventory.png
+ :alt: Compass insert new document into collection
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +30,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +39,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +48,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -58,7 +57,7 @@
- id: nodejs
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/node_insert.js
:language: javascript
:dedent: 6
@@ -67,7 +66,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -76,7 +75,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -85,7 +84,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 6
@@ -94,7 +93,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -103,7 +102,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-insert-2.rst b/source/includes/driver-examples/driver-example-insert-2.rst
index 67e4d034280..9de20737ffd 100644
--- a/source/includes/driver-examples/driver-example-insert-2.rst
+++ b/source/includes/driver-examples/driver-example-insert-2.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { item: "canvas" } )
@@ -11,6 +11,7 @@
- id: compass
content: |
.. figure:: /images/compass-query-collection.png
+ :alt: Query for matching documents in a collection
Specify a filter in the MongoDB Compass query bar and click
:guilabel:`Find` to execute the query.
@@ -25,7 +26,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -34,7 +35,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -43,7 +44,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -52,7 +53,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -69,7 +70,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -78,7 +79,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -87,7 +88,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -96,7 +97,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -105,7 +106,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-insert-3.rst b/source/includes/driver-examples/driver-example-insert-3.rst
index 6ac4c949fb9..0979786edd2 100644
--- a/source/includes/driver-examples/driver-example-insert-3.rst
+++ b/source/includes/driver-examples/driver-example-insert-3.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.insertMany([
@@ -12,15 +12,13 @@
{ item: "mousepad", qty: 25, tags: ["gel", "blue"], size: { h: 19, w: 22.85, uom: "cm" } }
])
- .. only:: website
-
- You can run the operation in the web shell below:
-
- .. include:: /includes/fact-mws.rst
+ .. include:: /includes/fact-mws-intro.rst
+
+ .. include:: /includes/fact-mws.rst
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -29,7 +27,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -38,7 +36,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -47,7 +45,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -64,7 +62,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -73,7 +71,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -82,7 +80,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -91,7 +89,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -100,7 +98,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-10.rst b/source/includes/driver-examples/driver-example-query-10.rst
index 39715e46e5c..1cb7601a903 100644
--- a/source/includes/driver-examples/driver-example-query-10.rst
+++ b/source/includes/driver-examples/driver-example-query-10.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { status: { $in: [ "A", "D" ] } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ status: { $in: [ "A", "D" ] } }
.. figure:: /images/compass-find-filter-query-op.png
+ :alt: Query using query operators
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-11.rst b/source/includes/driver-examples/driver-example-query-11.rst
index a6e9b16c325..b020bf5f7e8 100644
--- a/source/includes/driver-examples/driver-example-query-11.rst
+++ b/source/includes/driver-examples/driver-example-query-11.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { status: "A", qty: { $lt: 30 } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ status: "A", qty: { $lt: 30 } }
.. figure:: /images/compass-find-filter-and.png
+ :alt: Query using multiple conditions with AND
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-12.rst b/source/includes/driver-examples/driver-example-query-12.rst
index 41fe1021ba6..d5e0cc55f56 100644
--- a/source/includes/driver-examples/driver-example-query-12.rst
+++ b/source/includes/driver-examples/driver-example-query-12.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { $or: [ { status: "A" }, { qty: { $lt: 30 } } ] } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ $or: [ { status: "A" }, { qty: { $lt: 30 } } ] }
.. figure:: /images/compass-find-filter-or.png
+ :alt: Query using OR
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-13.rst b/source/includes/driver-examples/driver-example-query-13.rst
index 32ba98a5233..cc28fee06d4 100644
--- a/source/includes/driver-examples/driver-example-query-13.rst
+++ b/source/includes/driver-examples/driver-example-query-13.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( {
@@ -16,17 +16,18 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ status: "A", $or: [ { qty: { $lt: 30 } }, { item: /^p/ } ] }
.. figure:: /images/compass-find-filter-and-or.png
+ :alt: Query using AND as well as OR
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -35,7 +36,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -44,7 +45,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -53,7 +54,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -70,7 +71,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -79,7 +80,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -88,7 +89,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -97,7 +98,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -106,7 +107,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-14.rst b/source/includes/driver-examples/driver-example-query-14.rst
index 44402133010..f2ef0d0ead4 100644
--- a/source/includes/driver-examples/driver-example-query-14.rst
+++ b/source/includes/driver-examples/driver-example-query-14.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.insertMany( [
@@ -14,11 +14,9 @@
{ item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" }
]);
- .. only:: website
-
- You can run the operation in the web shell below:
-
- .. include:: /includes/fact-mws.rst
+ .. include:: /includes/fact-mws-intro.rst
+
+ .. include:: /includes/fact-mws.rst
- id: compass
content: |
@@ -37,7 +35,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -46,7 +44,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -55,7 +53,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -64,7 +62,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -81,7 +79,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -90,7 +88,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -99,7 +97,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 6
@@ -108,7 +106,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -117,7 +115,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-15.rst b/source/includes/driver-examples/driver-example-query-15.rst
index 76b4ce299c9..041dd727623 100644
--- a/source/includes/driver-examples/driver-example-query-15.rst
+++ b/source/includes/driver-examples/driver-example-query-15.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { size: { h: 14, w: 21, uom: "cm" } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ size: { h: 14, w: 21, uom: "cm" } }
.. figure:: /images/compass-match-embedded.png
+ :alt: Query embedded field
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-16.rst b/source/includes/driver-examples/driver-example-query-16.rst
index 3b0d3dc465f..55f09bcef5b 100644
--- a/source/includes/driver-examples/driver-example-query-16.rst
+++ b/source/includes/driver-examples/driver-example-query-16.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { size: { w: 21, h: 14, uom: "cm" } } )
@@ -11,10 +11,11 @@
- id: compass
content: |
.. figure:: /images/compass-find-embedded-no-match.png
+ :alt: Query embedded field
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -23,7 +24,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -32,7 +33,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -41,7 +42,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -58,7 +59,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -67,7 +68,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -76,7 +77,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -85,7 +86,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -94,7 +95,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-17.rst b/source/includes/driver-examples/driver-example-query-17.rst
index e29641e8480..47e5dd8a677 100644
--- a/source/includes/driver-examples/driver-example-query-17.rst
+++ b/source/includes/driver-examples/driver-example-query-17.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { "size.uom": "in" } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ "size.uom": "in" }
.. figure:: /images/compass-find-nested-field.png
+ :alt: Query single nested field
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-18.rst b/source/includes/driver-examples/driver-example-query-18.rst
index e4516c78d22..eb257d00a00 100644
--- a/source/includes/driver-examples/driver-example-query-18.rst
+++ b/source/includes/driver-examples/driver-example-query-18.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { "size.h": { $lt: 15 } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ "size.h": { $lt: 15 } }
.. figure:: /images/compass-find-nested-query-op.png
+ :alt: Query single nested field
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-19.rst b/source/includes/driver-examples/driver-example-query-19.rst
index 48455e654e9..2a56ddc6322 100644
--- a/source/includes/driver-examples/driver-example-query-19.rst
+++ b/source/includes/driver-examples/driver-example-query-19.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { "size.h": { $lt: 15 }, "size.uom": "in", status: "D" } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ "size.h": { $lt: 15 }, "size.uom": "in", status: "D" }
.. figure:: /images/compass-find-embedded-and.png
+ :alt: Query multiple nested fields
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-20.rst b/source/includes/driver-examples/driver-example-query-20.rst
index 76654e33582..4da3011f23e 100644
--- a/source/includes/driver-examples/driver-example-query-20.rst
+++ b/source/includes/driver-examples/driver-example-query-20.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.insertMany([
@@ -14,11 +14,9 @@
{ item: "postcard", qty: 45, tags: ["blue"], dim_cm: [ 10, 15.25 ] }
]);
- .. only:: website
-
- You can run the operation in the web shell below:
-
- .. include:: /includes/fact-mws.rst
+ .. include:: /includes/fact-mws-intro.rst
+
+ .. include:: /includes/fact-mws.rst
- id: compass
content: |
@@ -38,7 +36,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -47,7 +45,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -56,7 +54,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -65,7 +63,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -82,7 +80,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -91,7 +89,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -100,7 +98,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 6
@@ -109,7 +107,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -118,7 +116,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-21.rst b/source/includes/driver-examples/driver-example-query-21.rst
index 15b93af52f9..c0a575d6277 100644
--- a/source/includes/driver-examples/driver-example-query-21.rst
+++ b/source/includes/driver-examples/driver-example-query-21.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { tags: ["red", "blank"] } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ tags: ["red", "blank"] }
.. figure:: /images/compass-array-match-exact.png
+ :alt: Query array matching exactly
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-22.rst b/source/includes/driver-examples/driver-example-query-22.rst
index 9901e22caba..c45f13eb958 100644
--- a/source/includes/driver-examples/driver-example-query-22.rst
+++ b/source/includes/driver-examples/driver-example-query-22.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { tags: { $all: ["red", "blank"] } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ tags: { $all: ["red", "blank"] } }
.. figure:: /images/compass-array-match-all.png
+ :alt: Query array matching all criteria
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-23.rst b/source/includes/driver-examples/driver-example-query-23.rst
index 2948b8b081d..4f481c9c291 100644
--- a/source/includes/driver-examples/driver-example-query-23.rst
+++ b/source/includes/driver-examples/driver-example-query-23.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { tags: "red" } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ tags: "red" }
.. figure:: /images/compass-array-elem-match.png
+ :alt: Query array matching multiple criteria
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-24.rst b/source/includes/driver-examples/driver-example-query-24.rst
index ff8028e64ef..35e98ba5e67 100644
--- a/source/includes/driver-examples/driver-example-query-24.rst
+++ b/source/includes/driver-examples/driver-example-query-24.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { dim_cm: { $gt: 25 } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ dim_cm: { $gt: 25 } }
.. figure:: /images/compass-array-query-op.png
+ :alt: Query array for at least one matching element
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-25.rst b/source/includes/driver-examples/driver-example-query-25.rst
index 1657458ceef..fd21527ca1a 100644
--- a/source/includes/driver-examples/driver-example-query-25.rst
+++ b/source/includes/driver-examples/driver-example-query-25.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { dim_cm: { $gt: 15, $lt: 20 } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ dim_cm: { $gt: 15, $lt: 20 } }
.. figure:: /images/compass-array-compound-filter.png
+ :alt: Query array using a compound filter
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-26.rst b/source/includes/driver-examples/driver-example-query-26.rst
index 1c3633b7c2d..be53400c194 100644
--- a/source/includes/driver-examples/driver-example-query-26.rst
+++ b/source/includes/driver-examples/driver-example-query-26.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { dim_cm: { $elemMatch: { $gt: 22, $lt: 30 } } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ dim_cm: { $elemMatch: { $gt: 22, $lt: 30 } } }
.. figure:: /images/compass-array-compound-multiple-criteria.png
+ :alt: Query array by multiple conditions
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-27.rst b/source/includes/driver-examples/driver-example-query-27.rst
index b28596c4a33..c4b224af31d 100644
--- a/source/includes/driver-examples/driver-example-query-27.rst
+++ b/source/includes/driver-examples/driver-example-query-27.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { "dim_cm.1": { $gt: 25 } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ "dim_cm.1": { $gt: 25 } }
.. figure:: /images/compass-array-match-by-index.png
+ :alt: Query array by index
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-28.rst b/source/includes/driver-examples/driver-example-query-28.rst
index 7c32634d02f..49df5a49853 100644
--- a/source/includes/driver-examples/driver-example-query-28.rst
+++ b/source/includes/driver-examples/driver-example-query-28.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { "tags": { $size: 3 } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ "tags": { $size: 3 } }
.. figure:: /images/compass-array-query-by-size.png
+ :alt: Query for array by number of elements
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-29.rst b/source/includes/driver-examples/driver-example-query-29.rst
index f7db2119a61..86ea5209c94 100644
--- a/source/includes/driver-examples/driver-example-query-29.rst
+++ b/source/includes/driver-examples/driver-example-query-29.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.insertMany( [
@@ -14,11 +14,9 @@
{ item: "postcard", instock: [ { warehouse: "B", qty: 15 }, { warehouse: "C", qty: 35 } ] }
]);
- .. only:: website
-
- You can run the operation in the web shell below:
-
- .. include:: /includes/fact-mws.rst
+ .. include:: /includes/fact-mws-intro.rst
+
+ .. include:: /includes/fact-mws.rst
- id: compass
content: |
@@ -37,7 +35,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -46,7 +44,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -55,7 +53,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -64,7 +62,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -81,7 +79,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -90,7 +88,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -99,7 +97,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 6
@@ -108,7 +106,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -117,7 +115,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-30.rst b/source/includes/driver-examples/driver-example-query-30.rst
index 164aada91d5..33bb00c8416 100644
--- a/source/includes/driver-examples/driver-example-query-30.rst
+++ b/source/includes/driver-examples/driver-example-query-30.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { "instock": { warehouse: "A", qty: 5 } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ "instock": { warehouse: "A", qty: 5 } }
.. figure:: /images/compass-find-nested-in-array.png
+ :alt: Query for nested array element
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-31.rst b/source/includes/driver-examples/driver-example-query-31.rst
index 29a90a3ac80..468f0cf7a30 100644
--- a/source/includes/driver-examples/driver-example-query-31.rst
+++ b/source/includes/driver-examples/driver-example-query-31.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { "instock": { qty: 5, warehouse: "A" } } )
@@ -11,10 +11,11 @@
- id: compass
content: |
.. figure:: /images/compass-find-nested-array-no-match.png
+ :alt: Query for nested array element
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -23,7 +24,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -32,7 +33,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -41,7 +42,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -58,7 +59,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -67,7 +68,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -76,7 +77,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -85,7 +86,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -94,7 +95,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-32.rst b/source/includes/driver-examples/driver-example-query-32.rst
index d5db7452a09..ddf786d967a 100644
--- a/source/includes/driver-examples/driver-example-query-32.rst
+++ b/source/includes/driver-examples/driver-example-query-32.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { 'instock.0.qty': { $lte: 20 } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ 'instock.0.qty': { $lte: 20 } }
.. figure:: /images/compass-find-array-index-embedded-doc.png
+ :alt: Query for array element matching single condition
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-33.rst b/source/includes/driver-examples/driver-example-query-33.rst
index 1c857da7233..64b951aa19f 100644
--- a/source/includes/driver-examples/driver-example-query-33.rst
+++ b/source/includes/driver-examples/driver-example-query-33.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { 'instock.qty': { $lte: 20 } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ 'instock.qty': { $lte: 20 } }
.. figure:: /images/compass-find-array-embedded-field-condition.png
+ :alt: Query for embedded field matching single condition
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-34.rst b/source/includes/driver-examples/driver-example-query-34.rst
index 29cacd10fe8..464e151e60f 100644
--- a/source/includes/driver-examples/driver-example-query-34.rst
+++ b/source/includes/driver-examples/driver-example-query-34.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { "instock": { $elemMatch: { qty: 5, warehouse: "A" } } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ "instock": { $elemMatch: { qty: 5, warehouse: "A" } } }
.. figure:: /images/compass-array-multiple-cond-single-doc.png
+ :alt: Query for single document matching multiple conditions
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-35.rst b/source/includes/driver-examples/driver-example-query-35.rst
index 09e528c992d..d69fd03fd05 100644
--- a/source/includes/driver-examples/driver-example-query-35.rst
+++ b/source/includes/driver-examples/driver-example-query-35.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { "instock": { $elemMatch: { qty: { $gt: 10, $lte: 20 } } } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ "instock": { $elemMatch: { qty: { $gt: 10, $lte: 20 } } } }
.. figure:: /images/compass-array-multiple-cond-single-doc-2.png
+ :alt: Query for single document matching multiple conditions
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-36.rst b/source/includes/driver-examples/driver-example-query-36.rst
index b32072da855..a039bb8ab5c 100644
--- a/source/includes/driver-examples/driver-example-query-36.rst
+++ b/source/includes/driver-examples/driver-example-query-36.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { "instock.qty": { $gt: 10, $lte: 20 } } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ "instock.qty": { $gt: 10, $lte: 20 } }
.. figure:: /images/compass-array-match-combination-of-elements.png
+ :alt: Query quantity value within range
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-37.rst b/source/includes/driver-examples/driver-example-query-37.rst
index 90240c0ea43..cacb26bbb12 100644
--- a/source/includes/driver-examples/driver-example-query-37.rst
+++ b/source/includes/driver-examples/driver-example-query-37.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { "instock.qty": 5, "instock.warehouse": "A" } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ "instock.qty": 5, "instock.warehouse": "A" }
.. figure:: /images/compass-array-match-combination-of-elements-2.png
+ :alt: Query matching quantity and warehouse location
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-38.rst b/source/includes/driver-examples/driver-example-query-38.rst
index 471adbca047..a85312e54fd 100644
--- a/source/includes/driver-examples/driver-example-query-38.rst
+++ b/source/includes/driver-examples/driver-example-query-38.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.insertMany([
@@ -11,11 +11,11 @@
{ _id: 2 }
])
- .. only:: website
-
- You can run the operation in the web shell below:
-
- .. include:: /includes/fact-mws.rst
+ .. include:: /includes/fact-mws-intro.rst
+
+ .. include:: /includes/fact-mws-intro.rst
+
+ .. include:: /includes/fact-mws.rst
- id: compass
content: |
@@ -31,7 +31,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -40,7 +40,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -49,7 +49,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -58,7 +58,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -75,7 +75,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -84,7 +84,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -93,7 +93,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 6
@@ -102,7 +102,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -111,7 +111,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-39.rst b/source/includes/driver-examples/driver-example-query-39.rst
index bed4f0b2489..c6878bd7dee 100644
--- a/source/includes/driver-examples/driver-example-query-39.rst
+++ b/source/includes/driver-examples/driver-example-query-39.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { item: null } )
@@ -14,16 +14,17 @@
:ref:`query bar ` and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ item: null }
.. figure:: /images/compass-find-null-field.png
+ :alt: Query null value or missing field
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -32,7 +33,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -41,7 +42,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -50,7 +51,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -67,7 +68,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -76,7 +77,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -85,7 +86,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -94,7 +95,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -103,7 +104,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-40.rst b/source/includes/driver-examples/driver-example-query-40.rst
index 6ad73bcb49a..3777e0764b6 100644
--- a/source/includes/driver-examples/driver-example-query-40.rst
+++ b/source/includes/driver-examples/driver-example-query-40.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { item : { $type: 10 } } )
@@ -14,16 +14,17 @@
:ref:`query bar ` and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ item : { $type: 10 } }
.. figure:: /images/compass-find-null-type-check.png
+ :alt: Find null type
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -32,7 +33,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -41,7 +42,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -50,7 +51,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -67,7 +68,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -76,7 +77,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -85,7 +86,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -94,7 +95,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -103,7 +104,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-41.rst b/source/includes/driver-examples/driver-example-query-41.rst
index 92ef013a36d..ec979093970 100644
--- a/source/includes/driver-examples/driver-example-query-41.rst
+++ b/source/includes/driver-examples/driver-example-query-41.rst
@@ -20,10 +20,11 @@
{ item : { $exists: false } }
.. figure:: /images/compass-find-null-existence-check.png
+ :alt: Query for null value
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -32,7 +33,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -41,7 +42,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -50,7 +51,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -67,7 +68,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -76,7 +77,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -85,7 +86,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -94,7 +95,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -103,7 +104,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-42.rst b/source/includes/driver-examples/driver-example-query-42.rst
index 5bacd477010..0a80f615b89 100644
--- a/source/includes/driver-examples/driver-example-query-42.rst
+++ b/source/includes/driver-examples/driver-example-query-42.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.insertMany( [
@@ -14,11 +14,9 @@
{ item: "postcard", status: "A", size: { h: 10, w: 15.25, uom: "cm" }, instock: [ { warehouse: "B", qty: 15 }, { warehouse: "C", qty: 35 } ] }
]);
- .. only:: website
-
- You can run the operation in the web shell below:
-
- .. include:: /includes/fact-mws.rst
+ .. include:: /includes/fact-mws-intro.rst
+
+ .. include:: /includes/fact-mws.rst
- id: compass
content: |
@@ -38,7 +36,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -47,7 +45,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -56,7 +54,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -65,7 +63,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -82,7 +80,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -91,7 +89,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -100,7 +98,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 6
@@ -109,7 +107,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -118,7 +116,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-43.rst b/source/includes/driver-examples/driver-example-query-43.rst
index 25ae07f72cc..92fb492d4af 100644
--- a/source/includes/driver-examples/driver-example-query-43.rst
+++ b/source/includes/driver-examples/driver-example-query-43.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { status: "A" } )
@@ -21,7 +21,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -30,7 +30,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -39,7 +39,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -48,7 +48,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -65,7 +65,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -74,7 +74,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -83,7 +83,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -92,7 +92,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -101,7 +101,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-44.rst b/source/includes/driver-examples/driver-example-query-44.rst
index 71ae6e21814..02ffc83aba5 100644
--- a/source/includes/driver-examples/driver-example-query-44.rst
+++ b/source/includes/driver-examples/driver-example-query-44.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { status: "A" }, { item: 1, status: 1 } )
@@ -32,7 +32,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -41,7 +41,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -56,7 +56,7 @@
com.mongodb.client.model.Projections_ class to create the
projection documents.
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -65,7 +65,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -82,7 +82,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -91,7 +91,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -100,7 +100,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -109,7 +109,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -118,7 +118,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-45.rst b/source/includes/driver-examples/driver-example-query-45.rst
index 274c3fbc247..72c98231c12 100644
--- a/source/includes/driver-examples/driver-example-query-45.rst
+++ b/source/includes/driver-examples/driver-example-query-45.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { status: "A" }, { item: 1, status: 1, _id: 0 } )
@@ -31,7 +31,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -40,7 +40,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -55,7 +55,7 @@
com.mongodb.client.model.Projections_ class to create the
projection documents.
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -64,7 +64,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -81,7 +81,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -90,7 +90,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -99,7 +99,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -108,7 +108,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -117,7 +117,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-46.rst b/source/includes/driver-examples/driver-example-query-46.rst
index 9175eebcb86..be365b1e253 100644
--- a/source/includes/driver-examples/driver-example-query-46.rst
+++ b/source/includes/driver-examples/driver-example-query-46.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { status: "A" }, { status: 0, instock: 0 } )
@@ -31,7 +31,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -40,7 +40,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -55,7 +55,7 @@
com.mongodb.client.model.Projections_ class to create the
projection documents.
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -64,7 +64,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -81,7 +81,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -90,7 +90,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -99,7 +99,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -108,7 +108,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -117,7 +117,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-47.rst b/source/includes/driver-examples/driver-example-query-47.rst
index 791cce6f7ed..7b9cb4e70fe 100644
--- a/source/includes/driver-examples/driver-example-query-47.rst
+++ b/source/includes/driver-examples/driver-example-query-47.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find(
@@ -34,7 +34,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -43,7 +43,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -58,7 +58,7 @@
com.mongodb.client.model.Projections_ class to create the
projection documents.
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -67,7 +67,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -84,7 +84,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -93,7 +93,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -102,7 +102,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -111,7 +111,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -120,7 +120,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-48.rst b/source/includes/driver-examples/driver-example-query-48.rst
index e44c1f92c51..84eec839a2e 100644
--- a/source/includes/driver-examples/driver-example-query-48.rst
+++ b/source/includes/driver-examples/driver-example-query-48.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find(
@@ -34,7 +34,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -43,7 +43,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -58,7 +58,7 @@
com.mongodb.client.model.Projections_ class to create the
projection documents.
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -67,7 +67,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -84,7 +84,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -93,7 +93,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -102,7 +102,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -111,7 +111,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -120,7 +120,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-49.rst b/source/includes/driver-examples/driver-example-query-49.rst
index a63773a19c0..198ac71ad0e 100644
--- a/source/includes/driver-examples/driver-example-query-49.rst
+++ b/source/includes/driver-examples/driver-example-query-49.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { status: "A" }, { item: 1, status: 1, "instock.qty": 1 } )
@@ -31,7 +31,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -40,7 +40,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -55,7 +55,7 @@
com.mongodb.client.model.Projections_ class to create the
projection documents.
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -64,7 +64,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -81,7 +81,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -90,7 +90,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -99,7 +99,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -108,7 +108,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -117,7 +117,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-50.rst b/source/includes/driver-examples/driver-example-query-50.rst
index 0ea57407199..1e62f862971 100644
--- a/source/includes/driver-examples/driver-example-query-50.rst
+++ b/source/includes/driver-examples/driver-example-query-50.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { status: "A" }, { item: 1, status: 1, instock: { $slice: -1 } } )
@@ -34,7 +34,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -43,7 +43,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -58,7 +58,7 @@
com.mongodb.client.model.Projections_ class to create the
projection documents.
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -67,7 +67,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -84,7 +84,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -93,7 +93,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -102,7 +102,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -111,7 +111,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -120,7 +120,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-6.rst b/source/includes/driver-examples/driver-example-query-6.rst
index 617e93227cd..1d73a188a50 100644
--- a/source/includes/driver-examples/driver-example-query-6.rst
+++ b/source/includes/driver-examples/driver-example-query-6.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.insertMany([
@@ -14,11 +14,9 @@
{ item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" }
]);
- .. only:: website
-
- You can run the operation in the web shell below:
-
- .. include:: /includes/fact-mws.rst
+ .. include:: /includes/fact-mws-intro.rst
+
+ .. include:: /includes/fact-mws.rst
- id: compass
content: |
@@ -37,7 +35,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -46,7 +44,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -55,7 +53,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -64,7 +62,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -81,7 +79,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -90,7 +88,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -99,7 +97,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 6
@@ -108,7 +106,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -117,7 +115,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-7.rst b/source/includes/driver-examples/driver-example-query-7.rst
index 2a9a9b83579..68eeb414057 100644
--- a/source/includes/driver-examples/driver-example-query-7.rst
+++ b/source/includes/driver-examples/driver-example-query-7.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( {} )
@@ -12,10 +12,11 @@
content: |
.. figure:: /images/compass-select-all.png
+ :alt: Compass select all documents in collection
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -24,7 +25,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -33,7 +34,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -42,7 +43,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -59,7 +60,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -68,7 +69,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -77,7 +78,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -86,7 +87,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -95,7 +96,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-query-9.rst b/source/includes/driver-examples/driver-example-query-9.rst
index 7aaf2342e5d..ba9e1824dac 100644
--- a/source/includes/driver-examples/driver-example-query-9.rst
+++ b/source/includes/driver-examples/driver-example-query-9.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.find( { status: "D" } )
@@ -13,16 +13,17 @@
Copy the following filter into the Compass query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ status: "D" }
.. figure:: /images/compass-find-filter-inventory.png
+ :alt: Query using equality condition
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -31,7 +32,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -40,7 +41,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +50,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -66,7 +67,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -75,7 +76,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -84,7 +85,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -93,7 +94,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -102,7 +103,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-transactions-intro-1.rst b/source/includes/driver-examples/driver-example-transactions-intro-1.rst
index 7b2659a146a..9a6f95aad91 100644
--- a/source/includes/driver-examples/driver-example-transactions-intro-1.rst
+++ b/source/includes/driver-examples/driver-example-transactions-intro-1.rst
@@ -4,7 +4,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
diff --git a/source/includes/driver-examples/driver-example-transactions-retry-1.rst b/source/includes/driver-examples/driver-example-transactions-retry-1.rst
index 23b7a6fc9c2..e03f311dade 100644
--- a/source/includes/driver-examples/driver-example-transactions-retry-1.rst
+++ b/source/includes/driver-examples/driver-example-transactions-retry-1.rst
@@ -35,7 +35,7 @@
To associate read and write operations with a transaction, you **must**
pass the session to each operation in the transaction.
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
diff --git a/source/includes/driver-examples/driver-example-transactions-retry-2.rst b/source/includes/driver-examples/driver-example-transactions-retry-2.rst
index 807e65a3b83..948cd603402 100644
--- a/source/includes/driver-examples/driver-example-transactions-retry-2.rst
+++ b/source/includes/driver-examples/driver-example-transactions-retry-2.rst
@@ -73,7 +73,7 @@
To associate read and write operations with a transaction, you **must**
pass the session to each operation in the transaction.
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/perl-transactions-examples.t
:language: perl
:start-after: Start Transactions Retry Example 2
diff --git a/source/includes/driver-examples/driver-example-transactions-retry-3.rst b/source/includes/driver-examples/driver-example-transactions-retry-3.rst
index 4e960fcbf35..c16e7933138 100644
--- a/source/includes/driver-examples/driver-example-transactions-retry-3.rst
+++ b/source/includes/driver-examples/driver-example-transactions-retry-3.rst
@@ -9,7 +9,7 @@
To associate read and write operations with a transaction, you **must**
pass the session to each operation in the transaction.
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
diff --git a/source/includes/driver-examples/driver-example-update-51.rst b/source/includes/driver-examples/driver-example-update-51.rst
index e15bfb17680..78c5fb013fa 100644
--- a/source/includes/driver-examples/driver-example-update-51.rst
+++ b/source/includes/driver-examples/driver-example-update-51.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.insertMany( [
@@ -19,11 +19,9 @@
{ item: "sketch pad", qty: 95, size: { h: 22.85, w: 30.5, uom: "cm" }, status: "A" }
] );
- .. only:: website
-
- You can run the operation in the web shell below:
-
- .. include:: /includes/fact-mws.rst
+ .. include:: /includes/fact-mws-intro.rst
+
+ .. include:: /includes/fact-mws.rst
- id: compass
content: |
@@ -47,7 +45,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -56,7 +54,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -65,7 +63,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -74,7 +72,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -91,7 +89,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -100,7 +98,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -109,7 +107,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 6
@@ -118,7 +116,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -127,7 +125,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-update-52.rst b/source/includes/driver-examples/driver-example-update-52.rst
index 964f0e19abf..e2277c7d9f5 100644
--- a/source/includes/driver-examples/driver-example-update-52.rst
+++ b/source/includes/driver-examples/driver-example-update-52.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.updateOne(
@@ -39,7 +39,7 @@
Copy the following filter document into the query bar and click
:guilabel:`Find`:
- .. class:: copyable-code
+
.. code-block:: javascript
{ item: "paper" }
@@ -109,7 +109,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -118,7 +118,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -129,7 +129,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -140,7 +140,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -161,7 +161,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -172,7 +172,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -183,7 +183,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -194,7 +194,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -205,7 +205,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-update-53.rst b/source/includes/driver-examples/driver-example-update-53.rst
index 37d351bc61d..ecd1c7ee557 100644
--- a/source/includes/driver-examples/driver-example-update-53.rst
+++ b/source/includes/driver-examples/driver-example-update-53.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.updateMany(
@@ -18,7 +18,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -27,7 +27,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -38,7 +38,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -49,7 +49,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -70,7 +70,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -81,7 +81,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -92,7 +92,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -103,7 +103,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -114,7 +114,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-examples/driver-example-update-54.rst b/source/includes/driver-examples/driver-example-update-54.rst
index 320af572e69..25ff83053ea 100644
--- a/source/includes/driver-examples/driver-example-update-54.rst
+++ b/source/includes/driver-examples/driver-example-update-54.rst
@@ -3,7 +3,7 @@
tabs:
- id: shell
content: |
- .. class:: copyable-code
+
.. code-block:: javascript
db.inventory.replaceOne(
@@ -13,7 +13,7 @@
- id: python
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
@@ -22,7 +22,7 @@
- id: motor
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
@@ -31,7 +31,7 @@
- id: java-sync
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
@@ -40,7 +40,7 @@
- id: java-async
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
@@ -57,7 +57,7 @@
- id: php
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
@@ -66,7 +66,7 @@
- id: perl
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
@@ -75,7 +75,7 @@
- id: ruby
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
@@ -84,7 +84,7 @@
- id: scala
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
@@ -93,7 +93,7 @@
- id: csharp
content: |
- .. class:: copyable-code
+
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
diff --git a/source/includes/driver-list-collection-indexes-tabs.rst b/source/includes/driver-list-collection-indexes-tabs.rst
index 02d16d43be6..cc3cd6e1c21 100644
--- a/source/includes/driver-list-collection-indexes-tabs.rst
+++ b/source/includes/driver-list-collection-indexes-tabs.rst
@@ -1,19 +1,18 @@
.. tabs-drivers::
- tabs:
- - id: shell
- content: |
- List all Indexes on a Collection
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ .. tab::
+ :tabid: shell
- To return a list of all indexes on a collection, use the
- :method:`db.collection.getIndexes()` method or a similar
- :api:`method for your driver <>`.
+ List all Indexes on a Collection
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- For example, to view all indexes on the ``people`` collection,
- run the following command:
+ To return a list of all indexes on a collection, use the
+ :method:`db.collection.getIndexes()` method or a similar
+ :api:`method for your driver <>`.
- .. cssclass:: copyable-code
- .. code-block:: javascript
+ For example, to view all indexes on the ``people`` collection,
+ run the following command:
- db.people.getIndexes()
\ No newline at end of file
+ .. code-block:: javascript
+
+ db.people.getIndexes()
\ No newline at end of file
diff --git a/source/includes/driver-list-database-indexes-tabs.rst b/source/includes/driver-list-database-indexes-tabs.rst
index d16d40e56a1..a23ca5bfc01 100644
--- a/source/includes/driver-list-database-indexes-tabs.rst
+++ b/source/includes/driver-list-database-indexes-tabs.rst
@@ -4,7 +4,7 @@
- id: shell
content: |
List All Indexes for a Database
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To list all the collection indexes in a database, you can use the
following operation in the :binary:`~bin.mongo` shell:
diff --git a/source/includes/driver-remove-indexes-tabs.rst b/source/includes/driver-remove-indexes-tabs.rst
index 5b619a52171..8729543e574 100644
--- a/source/includes/driver-remove-indexes-tabs.rst
+++ b/source/includes/driver-remove-indexes-tabs.rst
@@ -18,8 +18,6 @@
For example, the following operation removes an ascending index on the
``tax-id`` field in the ``accounts`` collection:
- .. cssclass:: copyable-code
-
.. code-block:: javascript
db.accounts.dropIndex( { "tax-id": 1 } )
@@ -58,14 +56,13 @@
For example, the following command removes all indexes from
the ``accounts`` collection:
- .. cssclass:: copyable-code
.. code-block:: javascript
db.accounts.dropIndexes()
These shell helpers provide wrappers around the
- :dbcommand:`dropIndexes` :term:`database command`. Your :ecosystem:`client
- library ` may have a different or additional
+ :dbcommand:`dropIndexes` :term:`database command`. Your :driver:`client
+ library >` may have a different or additional
interface for these operations.
- id: compass
diff --git a/source/includes/example-objectToArray-arrayToObject.rst b/source/includes/example-objectToArray-arrayToObject.rst
index d93590e2110..18e9a131f05 100644
--- a/source/includes/example-objectToArray-arrayToObject.rst
+++ b/source/includes/example-objectToArray-arrayToObject.rst
@@ -8,8 +8,6 @@ Consider a ``inventory`` collection with the following documents:
The following aggregation pipeline operation calculates the total in
stock for each item and adds to the ``instock`` document:
-.. cssclass:: copyable-code
-
.. code-block:: javascript
db.inventory.aggregate( [
diff --git a/source/includes/examples-map-reduce.rst b/source/includes/examples-map-reduce.rst
index 42e8a72d96c..5ab9f382904 100644
--- a/source/includes/examples-map-reduce.rst
+++ b/source/includes/examples-map-reduce.rst
@@ -106,57 +106,55 @@ by the ``cust_id``, and calculate the sum of the ``price`` for each
Aggregation Alternative
```````````````````````
-.. container::
+Using the available aggregation pipeline operators, you can rewrite
+the map-reduce operation without defining custom functions:
- Using the available aggregation pipeline operators, you can rewrite
- the map-reduce operation without defining custom functions:
+.. code-block:: javascript
- .. code-block:: javascript
+ db.orders.aggregate([
+ { $group: { _id: "$cust_id", value: { $sum: "$price" } } },
+ { $out: "agg_alternative_1" }
+ ])
- db.orders.aggregate([
- { $group: { _id: "$cust_id", value: { $sum: "$price" } } },
- { $out: "agg_alternative_1" }
- ])
+#. The :pipeline:`$group` stage groups by the ``cust_id`` and
+ calculates the ``value`` field (See also :group:`$sum`). The
+ ``value`` field contains the total ``price`` for each ``cust_id``.
- #. The :pipeline:`$group` stage groups by the ``cust_id`` and
- calculates the ``value`` field using :expression:`$sum`. The
- ``value`` field contains the total ``price`` for each ``cust_id``.
-
- This stage outputs these documents to the next stage:
+ The stage output the following documents to the next stage:
- .. code-block:: javascript
- :copyable: false
+ .. code-block:: javascript
+ :copyable: false
- { "_id" : "Don Quis", "value" : 155 }
- { "_id" : "Ant O. Knee", "value" : 95 }
- { "_id" : "Cam Elot", "value" : 60 }
- { "_id" : "Busby Bee", "value" : 125 }
+ { "_id" : "Don Quis", "value" : 155 }
+ { "_id" : "Ant O. Knee", "value" : 95 }
+ { "_id" : "Cam Elot", "value" : 60 }
+ { "_id" : "Busby Bee", "value" : 125 }
- #. Then, the :pipeline:`$out` writes the output to the collection
- ``agg_alternative_1``. Alternatively, you could use
- :pipeline:`$merge` instead of :pipeline:`$out`.
+#. Then, the :pipeline:`$out` writes the output to the collection
+ ``agg_alternative_1``. Alternatively, you could use
+ :pipeline:`$merge` instead of :pipeline:`$out`.
- #. Query the ``agg_alternative_1`` collection to verify the results:
+#. Query the ``agg_alternative_1`` collection to verify the results:
- .. code-block:: javascript
+ .. code-block:: javascript
- db.agg_alternative_1.find().sort( { _id: 1 } )
+ db.agg_alternative_1.find().sort( { _id: 1 } )
- The operation returns these documents:
+ The operation returns the following documents:
- .. code-block:: javascript
- :copyable: false
+ .. code-block:: javascript
+ :copyable: false
- { "_id" : "Ant O. Knee", "value" : 95 }
- { "_id" : "Busby Bee", "value" : 125 }
- { "_id" : "Cam Elot", "value" : 60 }
- { "_id" : "Don Quis", "value" : 155 }
+ { "_id" : "Ant O. Knee", "value" : 95 }
+ { "_id" : "Busby Bee", "value" : 125 }
+ { "_id" : "Cam Elot", "value" : 60 }
+ { "_id" : "Don Quis", "value" : 155 }
- .. seealso::
+.. seealso::
- For an alternative that uses custom aggregation expressions, see
- :ref:`Map-Reduce to Aggregation Pipeline Translation Examples
- `.
+ For an alternative that uses custom aggregation expressions, see
+ :ref:`Map-Reduce to Aggregation Pipeline Translation Examples
+ `.
.. map-reduce-sum-price-end
@@ -293,110 +291,146 @@ Example steps:
Aggregation Alternative
```````````````````````
+Using the available aggregation pipeline operators, you can rewrite
+the map-reduce operation without defining custom functions:
-.. container::
+.. code-block:: javascript
+
+ db.orders.aggregate( [
+ { $match: { ord_date: { $gte: new Date("2020-03-01") } } },
+ { $unwind: "$items" },
+ { $group: { _id: "$items.sku", qty: { $sum: "$items.qty" }, orders_ids: { $addToSet: "$_id" } } },
+ { $project: { value: { count: { $size: "$orders_ids" }, qty: "$qty", avg: { $divide: [ "$qty", { $size: "$orders_ids" } ] } } } },
+ { $merge: { into: "agg_alternative_3", on: "_id", whenMatched: "replace", whenNotMatched: "insert" } }
+ ] )
+
+#. The :pipeline:`$match` stage selects only those
+ documents with ``ord_date`` greater than or equal to ``new
+ Date("2020-03-01")``.
+
+#. The :pipeline:`$unwind` stage breaks down the document by
+ the ``items`` array field to output a document for each array
+ element. For example:
+
+ .. code-block:: javascript
+ :copyable: false
- Using the available aggregation pipeline operators, you can rewrite
- the map-reduce operation without defining custom functions:
+ { "_id" : 1, "cust_id" : "Ant O. Knee", "ord_date" : ISODate("2020-03-01T00:00:00Z"), "price" : 25, "items" : { "sku" : "oranges", "qty" : 5, "price" : 2.5 }, "status" : "A" }
+ { "_id" : 1, "cust_id" : "Ant O. Knee", "ord_date" : ISODate("2020-03-01T00:00:00Z"), "price" : 25, "items" : { "sku" : "apples", "qty" : 5, "price" : 2.5 }, "status" : "A" }
+ { "_id" : 2, "cust_id" : "Ant O. Knee", "ord_date" : ISODate("2020-03-08T00:00:00Z"), "price" : 70, "items" : { "sku" : "oranges", "qty" : 8, "price" : 2.5 }, "status" : "A" }
+ { "_id" : 2, "cust_id" : "Ant O. Knee", "ord_date" : ISODate("2020-03-08T00:00:00Z"), "price" : 70, "items" : { "sku" : "chocolates", "qty" : 5, "price" : 10 }, "status" : "A" }
+ { "_id" : 3, "cust_id" : "Busby Bee", "ord_date" : ISODate("2020-03-08T00:00:00Z"), "price" : 50, "items" : { "sku" : "oranges", "qty" : 10, "price" : 2.5 }, "status" : "A" }
+ { "_id" : 3, "cust_id" : "Busby Bee", "ord_date" : ISODate("2020-03-08T00:00:00Z"), "price" : 50, "items" : { "sku" : "pears", "qty" : 10, "price" : 2.5 }, "status" : "A" }
+ { "_id" : 4, "cust_id" : "Busby Bee", "ord_date" : ISODate("2020-03-18T00:00:00Z"), "price" : 25, "items" : { "sku" : "oranges", "qty" : 10, "price" : 2.5 }, "status" : "A" }
+ { "_id" : 5, "cust_id" : "Busby Bee", "ord_date" : ISODate("2020-03-19T00:00:00Z"), "price" : 50, "items" : { "sku" : "chocolates", "qty" : 5, "price" : 10 }, "status" : "A" }
+ ...
+
+#. The :pipeline:`$group` stage groups by the ``items.sku``, calculating for each sku:
+
+ - The ``qty`` field. The ``qty`` field contains the
+ total ``qty`` ordered per each ``items.sku`` (See :group:`$sum`).
+
+ - The ``orders_ids`` array. The ``orders_ids`` field contains an
+ array of distinct order ``_id``'s for the ``items.sku`` (See
+ :group:`$addToSet`).
.. code-block:: javascript
+ :copyable: false
- db.orders.aggregate( [
- { $match: { ord_date: { $gte: new Date("2020-03-01") } } },
- { $unwind: "$items" },
- { $group: { _id: "$items.sku", qty: { $sum: "$items.qty" }, orders_ids: { $addToSet: "$_id" } } },
- { $project: { value: { count: { $size: "$orders_ids" }, qty: "$qty", avg: { $divide: [ "$qty", { $size: "$orders_ids" } ] } } } },
- { $merge: { into: "agg_alternative_3", on: "_id", whenMatched: "replace", whenNotMatched: "insert" } }
- ] )
-
- #. The :pipeline:`$match` stage selects only those
- documents with ``ord_date`` greater than or equal to ``new
- Date("2020-03-01")``.
+ { "_id" : "chocolates", "qty" : 15, "orders_ids" : [ 2, 5, 8 ] }
+ { "_id" : "oranges", "qty" : 63, "orders_ids" : [ 4, 7, 3, 2, 9, 1, 10 ] }
+ { "_id" : "carrots", "qty" : 15, "orders_ids" : [ 6, 9 ] }
+ { "_id" : "apples", "qty" : 35, "orders_ids" : [ 9, 8, 1, 6 ] }
+ { "_id" : "pears", "qty" : 10, "orders_ids" : [ 3 ] }
+
+#. The :pipeline:`$project` stage reshapes the output document to
+ mirror the map-reduce's output to have two fields ``_id`` and
+ ``value``. The :pipeline:`$project` sets:
- #. The :pipeline:`$unwinds` stage breaks down the document by
- the ``items`` array field to output a document for each array
- element. For example:
-
- .. code-block:: javascript
- :copyable: false
-
- { "_id" : 1, "cust_id" : "Ant O. Knee", "ord_date" : ISODate("2020-03-01T00:00:00Z"), "price" : 25, "items" : { "sku" : "oranges", "qty" : 5, "price" : 2.5 }, "status" : "A" }
- { "_id" : 1, "cust_id" : "Ant O. Knee", "ord_date" : ISODate("2020-03-01T00:00:00Z"), "price" : 25, "items" : { "sku" : "apples", "qty" : 5, "price" : 2.5 }, "status" : "A" }
- { "_id" : 2, "cust_id" : "Ant O. Knee", "ord_date" : ISODate("2020-03-08T00:00:00Z"), "price" : 70, "items" : { "sku" : "oranges", "qty" : 8, "price" : 2.5 }, "status" : "A" }
- { "_id" : 2, "cust_id" : "Ant O. Knee", "ord_date" : ISODate("2020-03-08T00:00:00Z"), "price" : 70, "items" : { "sku" : "chocolates", "qty" : 5, "price" : 10 }, "status" : "A" }
- { "_id" : 3, "cust_id" : "Busby Bee", "ord_date" : ISODate("2020-03-08T00:00:00Z"), "price" : 50, "items" : { "sku" : "oranges", "qty" : 10, "price" : 2.5 }, "status" : "A" }
- { "_id" : 3, "cust_id" : "Busby Bee", "ord_date" : ISODate("2020-03-08T00:00:00Z"), "price" : 50, "items" : { "sku" : "pears", "qty" : 10, "price" : 2.5 }, "status" : "A" }
- { "_id" : 4, "cust_id" : "Busby Bee", "ord_date" : ISODate("2020-03-18T00:00:00Z"), "price" : 25, "items" : { "sku" : "oranges", "qty" : 10, "price" : 2.5 }, "status" : "A" }
- { "_id" : 5, "cust_id" : "Busby Bee", "ord_date" : ISODate("2020-03-19T00:00:00Z"), "price" : 50, "items" : { "sku" : "chocolates", "qty" : 5, "price" : 10 }, "status" : "A" }
- ...
-
- #. The :pipeline:`$group` stage groups by the ``items.sku``, calculating for each sku:
-
- - The ``qty`` field. The ``qty`` field contains the
- total ``qty`` ordered per each ``items.sku`` using
- :expression:`$sum`.
-
- - The ``orders_ids`` array. The ``orders_ids`` field contains an
- array of distinct order ``_id``'s for the ``items.sku`` using
- :expression:`$addToSet`.
-
- .. code-block:: javascript
- :copyable: false
-
- { "_id" : "chocolates", "qty" : 15, "orders_ids" : [ 2, 5, 8 ] }
- { "_id" : "oranges", "qty" : 63, "orders_ids" : [ 4, 7, 3, 2, 9, 1, 10 ] }
- { "_id" : "carrots", "qty" : 15, "orders_ids" : [ 6, 9 ] }
- { "_id" : "apples", "qty" : 35, "orders_ids" : [ 9, 8, 1, 6 ] }
- { "_id" : "pears", "qty" : 10, "orders_ids" : [ 3 ] }
-
- #. The :pipeline:`$project` stage reshapes the output document to
- mirror the map-reduce's output to have two fields ``_id`` and
- ``value``. The :pipeline:`$project` sets:
-
- - the ``value.count`` to the size of the ``orders_ids`` array
- using :expression:`$size`.
+#. The :pipeline:`$unwind` stage breaks down the document by
+ the ``items`` array field to output a document for each array
+ element. For example:
- - the ``value.qty`` to the ``qty`` field of input document.
-
- - the ``value.avg`` to the average number of qty per order
- using :expression:`$divide` and :expression:`$size`.
+ .. code-block:: javascript
+ :copyable: false
- .. code-block:: javascript
- :copyable: false
+ { "_id" : 1, "cust_id" : "Ant O. Knee", "ord_date" : ISODate("2020-03-01T00:00:00Z"), "price" : 25, "items" : { "sku" : "oranges", "qty" : 5, "price" : 2.5 }, "status" : "A" }
+ { "_id" : 1, "cust_id" : "Ant O. Knee", "ord_date" : ISODate("2020-03-01T00:00:00Z"), "price" : 25, "items" : { "sku" : "apples", "qty" : 5, "price" : 2.5 }, "status" : "A" }
+ { "_id" : 2, "cust_id" : "Ant O. Knee", "ord_date" : ISODate("2020-03-08T00:00:00Z"), "price" : 70, "items" : { "sku" : "oranges", "qty" : 8, "price" : 2.5 }, "status" : "A" }
+ { "_id" : 2, "cust_id" : "Ant O. Knee", "ord_date" : ISODate("2020-03-08T00:00:00Z"), "price" : 70, "items" : { "sku" : "chocolates", "qty" : 5, "price" : 10 }, "status" : "A" }
+ { "_id" : 3, "cust_id" : "Busby Bee", "ord_date" : ISODate("2020-03-08T00:00:00Z"), "price" : 50, "items" : { "sku" : "oranges", "qty" : 10, "price" : 2.5 }, "status" : "A" }
+ { "_id" : 3, "cust_id" : "Busby Bee", "ord_date" : ISODate("2020-03-08T00:00:00Z"), "price" : 50, "items" : { "sku" : "pears", "qty" : 10, "price" : 2.5 }, "status" : "A" }
+ { "_id" : 4, "cust_id" : "Busby Bee", "ord_date" : ISODate("2020-03-18T00:00:00Z"), "price" : 25, "items" : { "sku" : "oranges", "qty" : 10, "price" : 2.5 }, "status" : "A" }
+ { "_id" : 5, "cust_id" : "Busby Bee", "ord_date" : ISODate("2020-03-19T00:00:00Z"), "price" : 50, "items" : { "sku" : "chocolates", "qty" : 5, "price" : 10 }, "status" : "A" }
+ ...
- { "_id" : "apples", "value" : { "count" : 4, "qty" : 35, "avg" : 8.75 } }
- { "_id" : "pears", "value" : { "count" : 1, "qty" : 10, "avg" : 10 } }
- { "_id" : "chocolates", "value" : { "count" : 3, "qty" : 15, "avg" : 5 } }
- { "_id" : "oranges", "value" : { "count" : 7, "qty" : 63, "avg" : 9 } }
- { "_id" : "carrots", "value" : { "count" : 2, "qty" : 15, "avg" : 7.5 } }
-
- #. Finally, the :pipeline:`$merge` writes the output to the
- collection ``agg_alternative_3``. If an existing document has the same
- key ``_id`` as the new result, the operation overwrites the existing
- document. If there is no existing document with the same key, the
- operation inserts the document.
+#. The :pipeline:`$group` stage groups by the ``items.sku``, calculating for each sku:
+
+ - The ``qty`` field. The ``qty`` field contains the
+ total ``qty`` ordered per each ``items.sku`` using
+ :group:`$sum`.
+
+ - The ``orders_ids`` array. The ``orders_ids`` field contains an
+ array of distinct order ``_id``'s for the ``items.sku`` using
+ :group:`$addToSet`.
+
+ .. code-block:: javascript
+ :copyable: false
+
+ { "_id" : "chocolates", "qty" : 15, "orders_ids" : [ 2, 5, 8 ] }
+ { "_id" : "oranges", "qty" : 63, "orders_ids" : [ 4, 7, 3, 2, 9, 1, 10 ] }
+ { "_id" : "carrots", "qty" : 15, "orders_ids" : [ 6, 9 ] }
+ { "_id" : "apples", "qty" : 35, "orders_ids" : [ 9, 8, 1, 6 ] }
+ { "_id" : "pears", "qty" : 10, "orders_ids" : [ 3 ] }
+
+#. The :pipeline:`$project` stage reshapes the output document to
+ mirror the map-reduce's output to have two fields ``_id`` and
+ ``value``. The :pipeline:`$project` sets:
+
+ - the ``value.count`` to the size of the ``orders_ids`` array
+ using :expression:`$size`.
+
+ - the ``value.qty`` to the ``qty`` field of input document.
- #. Query the ``agg_alternative_3`` collection to verify the results:
+ - the ``value.avg`` to the average number of qty per order
+ using :expression:`$divide` and :expression:`$size`.
+
+ .. code-block:: javascript
+ :copyable: false
+
+ { "_id" : "apples", "value" : { "count" : 4, "qty" : 35, "avg" : 8.75 } }
+ { "_id" : "pears", "value" : { "count" : 1, "qty" : 10, "avg" : 10 } }
+ { "_id" : "chocolates", "value" : { "count" : 3, "qty" : 15, "avg" : 5 } }
+ { "_id" : "oranges", "value" : { "count" : 7, "qty" : 63, "avg" : 9 } }
+ { "_id" : "carrots", "value" : { "count" : 2, "qty" : 15, "avg" : 7.5 } }
+
+#. Finally, the :pipeline:`$merge` writes the output to the
+ collection ``agg_alternative_3``. If an existing document has the same
+ key ``_id`` as the new result, the operation overwrites the existing
+ document. If there is no existing document with the same key, the
+ operation inserts the document.
+
+#. Query the ``agg_alternative_3`` collection to verify the results:
- .. code-block:: javascript
+ .. code-block:: javascript
- db.agg_alternative_3.find().sort( { _id: 1 } )
+ db.agg_alternative_3.find().sort( { _id: 1 } )
- The operation returns these documents:
+ The operation returns the following documents:
- .. code-block:: javascript
- :copyable: false
+ .. code-block:: javascript
+ :copyable: false
- { "_id" : "apples", "value" : { "count" : 4, "qty" : 35, "avg" : 8.75 } }
- { "_id" : "carrots", "value" : { "count" : 2, "qty" : 15, "avg" : 7.5 } }
- { "_id" : "chocolates", "value" : { "count" : 3, "qty" : 15, "avg" : 5 } }
- { "_id" : "oranges", "value" : { "count" : 7, "qty" : 63, "avg" : 9 } }
- { "_id" : "pears", "value" : { "count" : 1, "qty" : 10, "avg" : 10 } }
+ { "_id" : "apples", "value" : { "count" : 4, "qty" : 35, "avg" : 8.75 } }
+ { "_id" : "carrots", "value" : { "count" : 2, "qty" : 15, "avg" : 7.5 } }
+ { "_id" : "chocolates", "value" : { "count" : 3, "qty" : 15, "avg" : 5 } }
+ { "_id" : "oranges", "value" : { "count" : 7, "qty" : 63, "avg" : 9 } }
+ { "_id" : "pears", "value" : { "count" : 1, "qty" : 10, "avg" : 10 } }
- .. seealso::
+.. seealso::
- For an alternative that uses custom aggregation expressions, see
- :ref:`Map-Reduce to Aggregation Pipeline Translation Examples
- `.
+ For an alternative that uses custom aggregation expressions, see
+ :ref:`Map-Reduce to Aggregation Pipeline Translation Examples
+ `.
.. map-reduce-counts-end
diff --git a/source/includes/extracts-4.2-changes.yaml b/source/includes/extracts-4.2-changes.yaml
index fe1223dc0b7..38ba352c6c7 100644
--- a/source/includes/extracts-4.2-changes.yaml
+++ b/source/includes/extracts-4.2-changes.yaml
@@ -189,12 +189,12 @@ content: |
The :pipeline:`$planCacheStats` aggregation stage is preferred over
the following methods and commands, which have been deprecated in 4.2:
- - :method:`PlanCache.getPlansByQuery()`
- method/:dbcommand:`planCacheListPlans` command, and
+ - ``PlanCache.getPlansByQuery()``
+ method/``planCacheListPlans`` command, and
- - :method:`PlanCache.listQueryShapes()`
- method/:dbcommand:`planCacheListQueryShapes` command.
+ - ``PlanCache.listQueryShapes()``
+ method/``planCacheListQueryShapes`` command.
---
ref: 4.2-changes-options-tls-ssl
diff --git a/source/includes/extracts-4.4-changes.yaml b/source/includes/extracts-4.4-changes.yaml
index a8d7b38c9e0..bfc07bc96ec 100644
--- a/source/includes/extracts-4.4-changes.yaml
+++ b/source/includes/extracts-4.4-changes.yaml
@@ -138,7 +138,7 @@ content: |
As of MongoDB 4.4, there is no distinction between
the :expression:`$meta` aggregation operator and the
- :projection:`$meta` projection operator.
+ :expression:`$meta` projection operator.
---
ref: 4.4-changes-projection-sort-meta-list
@@ -318,8 +318,8 @@ content: |
ref: 4.4-changes-downgrade-floor
content: |
- .. admonition:: Downgrade Floor
- :class: warning
+ .. warning:: Downgrade Floor
+
If you need to downgrade form version 4.4, downgrade to 4.2.6 or
a later version. You cannot downgrade to 4.2.5 or an earlier
@@ -334,8 +334,8 @@ content: |
ref: 4.4-changes-index-builds-simultaneous-fcv
content: |
- .. admonition:: Requires ``featureCompatibilityVersion`` 4.4+
- :class: note
+ .. note:: Requires ``featureCompatibilityVersion`` 4.4+
+
Each :binary:`~bin.mongod` in the replica set or sharded cluster
*must* have :ref:`featureCompatibilityVersion ` set to at
@@ -519,10 +519,10 @@ content: |
:doc:`Windows MSI installer
` for both
Community and Enterprise editions does not
- include the :db-tools:`MongoDB Database Tools <>` (``mongoimport``,
+ include the :dbtools:`MongoDB Database Tools <>` (``mongoimport``,
``mongoexport``, etc). To download and install
the MongoDB Database Tools on Windows, see
- :db-tools:`Installing the MongoDB Database Tools `.
+ :dbtools:`Installing the MongoDB Database Tools `.
If you were relying on the MongoDB 4.2 or previous MSI installer to
install the Database Tools along with the MongoDB Server, you must
diff --git a/source/includes/extracts-built-in-roles.yaml b/source/includes/extracts-built-in-roles.yaml
index a4c0e750f70..b6cb8cc21a1 100644
--- a/source/includes/extracts-built-in-roles.yaml
+++ b/source/includes/extracts-built-in-roles.yaml
@@ -3,7 +3,7 @@ content: |
Provides the ability to read data on all *non*-system collections and
the :data:`system.js <.system.js>` collection.
- .. admonition:: Aside
+ .. note::
Starting in MongoDB 4.2, the role no longer provides privileges to
access the :data:`system.namespaces
diff --git a/source/includes/extracts-changestream.yaml b/source/includes/extracts-changestream.yaml
index e406579b075..d37b80482e6 100644
--- a/source/includes/extracts-changestream.yaml
+++ b/source/includes/extracts-changestream.yaml
@@ -1,7 +1,7 @@
ref: changestream-resume
content: |
- Unlike the MongoDB :ecosystem:`drivers `, the
+ Unlike the MongoDB :driver:`Drivers >`, the
:binary:`~bin.mongo` shell does not automatically attempt to resume a
change stream cursor after an error. The MongoDB drivers make *one*
attempt to automatically resume a change stream cursor after certain
diff --git a/source/includes/extracts-client-side-field-level-encryption.yaml b/source/includes/extracts-client-side-field-level-encryption.yaml
index 2b2102427f7..6bcce6d94fb 100644
--- a/source/includes/extracts-client-side-field-level-encryption.yaml
+++ b/source/includes/extracts-client-side-field-level-encryption.yaml
@@ -99,7 +99,7 @@ content: |
}
}
- Use the :binary:`Mongo()` constructor to create a database connection
+ Use the :method:`Mongo()` constructor to create a database connection
with the client-side field level encryption options. Replace the
``mongodb://myMongo.example.net`` URI with the :ref:`connection string
URI ` of the target cluster.
@@ -115,7 +115,7 @@ content: |
ref: csfle-enterprise-atlas-only
content: |
- .. admonition:: Enterprise Feature
+ .. note:: Enterprise Feature
The automatic feature of field level encryption is only available
in MongoDB 4.2 Enterprise and MongoDB Atlas 4.2 clusters.
diff --git a/source/includes/extracts-clone-copy-db-examples.yaml b/source/includes/extracts-clone-copy-db-examples.yaml
index 781636d3cbd..6b46abf9fbf 100644
--- a/source/includes/extracts-clone-copy-db-examples.yaml
+++ b/source/includes/extracts-clone-copy-db-examples.yaml
@@ -4,34 +4,32 @@ content: |
running on the default port 27017 to the ``examples`` database on the
same instance, you can:
- .. container::
-
- #. Use :binary:`~bin.mongodump` to dump the ``test`` database to
- an archive ``mongodump-test-db``:
-
- .. code-block:: sh
+ #. Use :binary:`~bin.mongodump` to dump the ``test`` database to
+ an archive ``mongodump-test-db``:
+
+ .. code-block:: sh
- mongodump --archive="mongodump-test-db" --db=test
+ mongodump --archive="mongodump-test-db" --db=test
- #. Use :binary:`~bin.mongorestore` with :option:`--nsFrom
- ` and :option:`--nsTo ` to restore (with database name change) from the
- archive:
+ #. Use :binary:`~bin.mongorestore` with :option:`--nsFrom
+ ` and :option:`--nsTo ` to restore (with database name change) from the
+ archive:
- .. code-block:: sh
+ .. code-block:: sh
- mongorestore --archive="mongodump-test-db" --nsFrom='test.*' --nsTo='examples.*'
+ mongorestore --archive="mongodump-test-db" --nsFrom='test.*' --nsTo='examples.*'
- .. tip::
+ .. tip::
- Include additional options as necessary, such as to specify
- the uri or host, username, password and authentication
- database.
+ Include additional options as necessary, such as to specify
+ the uri or host, username, password and authentication
+ database.
- Alternatively, instead of using an archive file, you can
- :binary:`~bin.mongodump` the ``test`` database to the standard
- output stream and pipe into :binary:`~bin.mongorestore`:
+ Alternatively, instead of using an archive file, you can
+ :binary:`~bin.mongodump` the ``test`` database to the standard
+ output stream and pipe into :binary:`~bin.mongorestore`:
- .. code-block:: sh
+ .. code-block:: sh
- mongodump --archive --db=test | mongorestore --archive --nsFrom='test.*' --nsTo='examples.*'
+ mongodump --archive --db=test | mongorestore --archive --nsFrom='test.*' --nsTo='examples.*'
...
\ No newline at end of file
diff --git a/source/includes/extracts-concurrency-consistency-recency.yaml b/source/includes/extracts-concurrency-consistency-recency.yaml
index 8eba8848f59..e36a924845f 100644
--- a/source/includes/extracts-concurrency-consistency-recency.yaml
+++ b/source/includes/extracts-concurrency-consistency-recency.yaml
@@ -146,7 +146,7 @@ content: |
With :rsconf:`writeConcernMajorityJournalDefault` set to ``false``,
MongoDB does not wait for :writeconcern:`w: "majority" <"majority">`
writes to be written to the on-disk journal before acknowledging the
- writes. As such, :writeconcern:`majority` write operations could
+ writes. As such, :writeconcern:`"majority"` write operations could
possibly roll back in the event of a transient loss (e.g. crash and
restart) of a majority of nodes in a given replica set.
diff --git a/source/includes/extracts-enterprise.yaml b/source/includes/extracts-enterprise.yaml
index bba135f2983..3e9a01fb538 100644
--- a/source/includes/extracts-enterprise.yaml
+++ b/source/includes/extracts-enterprise.yaml
@@ -36,106 +36,96 @@ content: |
name: Linux (Package Manager)
content: |
- .. container::
+ If you have installed MongoDB Community using a package
+ manager, follow the package manager instructions for your
+ operating system:
- If you have installed MongoDB Community using a package
- manager, follow the package manager instructions for your
- operating system:
+ - :doc:`Red Hat Enterprise or CentOS `
- - :doc:`Red Hat Enterprise or CentOS `
+ - :doc:`Ubuntu `
- - :doc:`Ubuntu `
+ - :doc:`Debian `
- - :doc:`Debian `
+ - :doc:`SUSE `
- - :doc:`SUSE `
+ - :doc:`Amazon Linux `
- - :doc:`Amazon Linux `
-
- During the installation, the package manager will remove the
- community packages; this will not affect the running
- deployment until you restart.
+ During the installation, the package manager will remove the
+ community packages; this will not affect the running
+ deployment until you restart.
- id: linux-manual
name: Linux (Manual Download)
content: |
- .. container::
-
- If you have not installed MongoDB using a package manager,
- you can manually download the MongoDB binaries from the
- `MongoDB Download Center
- `__. Follow
- the manual instructions, including specific prerequisites
- for MongoDB Enterprise, for your operating system:
-
- .. important::
+ If you have not installed MongoDB using a package manager,
+ you can manually download the MongoDB binaries from the
+ `MongoDB Download Center
+ `__. Follow
+ the manual instructions, including specific prerequisites
+ for MongoDB Enterprise, for your operating system:
- Install to a location different from that of your current
- Community edition.
-
- In the upgrade procedure, you will use the existing data
- directory and, if applicable, the existing configuration
- file.
+ .. important::
- - :doc:`Red Hat Enterprise or CentOS `
+ Install to a location different from that of your current
+ Community edition.
+
+ In the upgrade procedure, you will use the existing data
+ directory and, if applicable, the existing configuration
+ file.
- - :doc:`Ubuntu `
+ - :doc:`Red Hat Enterprise or CentOS `
- - :doc:`Debian `
+ - :doc:`Ubuntu `
- - :doc:`SUSE `
+ - :doc:`Debian `
- - :doc:`Amazon Linux `
+ - :doc:`SUSE `
-
+ - :doc:`Amazon Linux `
- id: windows
name: Windows
content: |
- .. container::
-
- .. important::
-
- You cannot use the ``.msi`` to install the Enterprise
- edition if you have the Community edition of the same
- release series installed on the same machine. That is, if
- you have version 4.4.0 Community edition installed, you
- cannot use the ``.msi`` to install the 4.4.0 or 4.4.1
- Enterprise edition.
-
- 1. Manually download the archive file from the `MongoDB
- Download Center
- `__.
-
- #. | To install, extract/unzip the file to a location
- different from that of your current Community
- edition.
-
- | In the upgrade procedure, you will use the existing
- data directory and, if applicable, the existing
- configuration file.
+ .. important::
+
+ You cannot use the ``.msi`` to install the Enterprise
+ edition if you have the Community edition of the same
+ release series installed on the same machine. That is, if
+ you have version 4.4.0 Community edition installed, you
+ cannot use the ``.msi`` to install the 4.4.0 or 4.4.1
+ Enterprise edition.
+
+ 1. Manually download the archive file from the `MongoDB
+ Download Center
+ `__.
+
+ #. To install, extract/unzip the file to a location
+ different from that of your current Community
+ edition.
+
+ In the upgrade procedure, you will use the existing
+ data directory and, if applicable, the existing
+ configuration file.
- id: macos
name: macOS
content: |
- .. container::
+ Install the binaries:
- Install the binaries:
+ 1. Manually download the archive file from the `MongoDB
+ Download Center
+ `__.
- 1. Manually download the archive file from the `MongoDB
- Download Center
- `__.
+ #. Extract the files to a location different
+ from that of your current Community edition. For
+ details on extracting the files, see :doc:`macOS
+ `.
- #. | Extract the files to a location different
- from that of your current Community edition. For
- details on extracting the files, see :doc:`macOS
- `.
+ In the upgrade procedure, you will use the existing
+ data directory and, if applicable, the existing
+ configuration file.
- | In the upgrade procedure, you will use the existing
- data directory and, if applicable, the existing
- configuration file.
-
...
diff --git a/source/includes/extracts-export-tools-performance-considerations-base.yaml b/source/includes/extracts-export-tools-performance-considerations-base.yaml
index d93bc4999ab..3216592e7ac 100644
--- a/source/includes/extracts-export-tools-performance-considerations-base.yaml
+++ b/source/includes/extracts-export-tools-performance-considerations-base.yaml
@@ -25,7 +25,9 @@ content: |
- Ensure that your backups are usable by restoring them to a test
MongoDB deployment.
- .. seealso:: :doc:`/core/backups` and :mms-docs:`MongoDB Cloud Manager Backup documentation `
+ .. seealso::
+
+ :doc:`/core/backups` and :mms-docs:`MongoDB Cloud Manager Backup documentation `
for more information on backing up MongoDB instances. Additionally,
consider the following reference documentation for the MongoDB import/export
tools:
diff --git a/source/includes/extracts-export-tools-performance-considerations.yaml b/source/includes/extracts-export-tools-performance-considerations.yaml
index 04a0eecc601..01bec7e645c 100644
--- a/source/includes/extracts-export-tools-performance-considerations.yaml
+++ b/source/includes/extracts-export-tools-performance-considerations.yaml
@@ -3,10 +3,10 @@ source:
file: extracts-export-tools-performance-considerations-base.yaml
ref: _tools-performance-considerations
replacement:
- out_tool: ":binary:`~bin.mongodump`"
- in_tool: ":binary:`~bin.mongorestore`"
+ out_tool: ":binary:`mongodump`"
+ in_tool: ":binary:`mongorestore`"
mongoDumpBullet: |
- - Use :option:`--oplog ` to capture incoming write operations during
+ - Use :option:`--oplog ` to capture incoming write operations during
the {{out_tool}} operation to ensure that the backups reflect
a consistent data state.
---
@@ -15,7 +15,7 @@ source:
file: extracts-export-tools-performance-considerations-base.yaml
ref: _tools-performance-considerations
replacement:
- out_tool: "program:`mongoexport`"
- in_tool: "program:`mongoimport`"
+ out_tool: ":program:`mongoexport`"
+ in_tool: ":program:`mongoimport`"
mongoDumpBullet: ""
...
diff --git a/source/includes/extracts-fact-aggregation-accumulator-base.yaml b/source/includes/extracts-fact-aggregation-accumulator-base.yaml
index 94e1310513f..0a5df666e08 100644
--- a/source/includes/extracts-fact-aggregation-accumulator-base.yaml
+++ b/source/includes/extracts-fact-aggregation-accumulator-base.yaml
@@ -20,7 +20,7 @@ content: |
- :pipeline:`$replaceWith` (Available starting in MongoDB 4.2)
- - :pipeline:`$match` stage that includes an :expression:`$expr` expression
+ - :pipeline:`$match` stage that includes an :query:`$expr` expression
---
ref: _fact-agg-accumulator-availability-change
@@ -40,7 +40,7 @@ content: |
- :pipeline:`$replaceWith` (Available starting in MongoDB 4.2)
- - :pipeline:`$match` stage that includes an :expression:`$expr` expression
+ - :pipeline:`$match` stage that includes an :query:`$expr` expression
In MongoDB 3.2 and earlier, {{accumulator}} is available in the
:pipeline:`$group` stage only.
diff --git a/source/includes/extracts-listCollections-auth.yaml b/source/includes/extracts-listCollections-auth.yaml
index 4416c708e73..570f5364df6 100644
--- a/source/includes/extracts-listCollections-auth.yaml
+++ b/source/includes/extracts-listCollections-auth.yaml
@@ -12,7 +12,7 @@ content: |
{ resource: { db: "test", collection: "" }, actions: [ "listCollections" ] }
The built-in role :authrole:`read` provides the privilege to run
- :dbcommand:`listCollection` for a specific database.
+ :dbcommand:`listCollections` for a specific database.
Starting in version 4.0, however, user without the required privilege
can run the command with **both** ``authorizedCollections`` and
@@ -68,7 +68,7 @@ content: |
``authorizedCollections`` and ``nameOnly`` options,
- A user must have the required access to run
- :dbcommand:`listCollection`.
+ :dbcommand:`listCollections`.
- If a user does not have required access and runs ``show
collections``, MongoDB uses the
diff --git a/source/includes/extracts-mongo-shell-deprecated-meta-operator.yaml b/source/includes/extracts-mongo-shell-deprecated-meta-operator.yaml
index 69996a7837c..ae43c095fac 100644
--- a/source/includes/extracts-mongo-shell-deprecated-meta-operator.yaml
+++ b/source/includes/extracts-mongo-shell-deprecated-meta-operator.yaml
@@ -1,8 +1,8 @@
ref: _mongo-shell-deprecated-meta-operator
content: |
- .. admonition:: Deprecated since {{version}}
- :class: note
+ .. note:: Deprecated since {{version}}
+
Starting in v3.2, the {{op}} operator is deprecated in the
:binary:`~bin.mongo` shell. In the :binary:`~bin.mongo` shell,
diff --git a/source/includes/extracts-parent-admonition-js-prevalence.yaml b/source/includes/extracts-parent-admonition-js-prevalence.yaml
index 5d2c2243ac7..09bf4911816 100644
--- a/source/includes/extracts-parent-admonition-js-prevalence.yaml
+++ b/source/includes/extracts-parent-admonition-js-prevalence.yaml
@@ -2,10 +2,10 @@ ref: _admonition-js-prevalence
content: |
- .. admonition:: JavaScript in MongoDB
+ .. note:: JavaScript in MongoDB
Although {{javascriptUsingOperation}} JavaScript, most
interactions with MongoDB do not use JavaScript but use an
- :ecosystem:`idiomatic driver ` in the language
+ :driver:`idiomatic driver >` in the language
of the interacting application.
...
\ No newline at end of file
diff --git a/source/includes/extracts-parent-fact-count-on-sharded-clusters.yaml b/source/includes/extracts-parent-fact-count-on-sharded-clusters.yaml
index 33b3ff3979b..85bdd1d7f91 100644
--- a/source/includes/extracts-parent-fact-count-on-sharded-clusters.yaml
+++ b/source/includes/extracts-parent-fact-count-on-sharded-clusters.yaml
@@ -26,6 +26,9 @@ content: |
{ $project: { _id: 0 } }
] )
- .. seealso:: :pipeline:`$collStats` to return an approximate count based on the collection's metadata.
+ .. seealso::
+
+ :pipeline:`$collStats` to return an approximate count based on the collection's metadata.
+
...
\ No newline at end of file
diff --git a/source/includes/extracts-projection.yaml b/source/includes/extracts-projection.yaml
index 9145279a98a..3671fee1fa1 100644
--- a/source/includes/extracts-projection.yaml
+++ b/source/includes/extracts-projection.yaml
@@ -287,8 +287,8 @@ content: |
ref: projection-language-consistency-admonition
content: |
- .. admonition:: Language Consistency
- :class: important
+ .. important:: Language Consistency
+
Starting in MongoDB 4.4, as part of making
:method:`~db.collection.find` and
diff --git a/source/includes/extracts-server-status-projection-base.yaml b/source/includes/extracts-server-status-projection-base.yaml
index cdd328b8130..f0eb28331d9 100644
--- a/source/includes/extracts-server-status-projection-base.yaml
+++ b/source/includes/extracts-server-status-projection-base.yaml
@@ -137,7 +137,7 @@ content: |
- Starting in MongoDB 4.2.1 (and 4.0.13), {{operationName}} includes:
- - :serverstatus:`electionMetrics`
+ - :ref:`electionMetrics `
- Starting in MongoDB 4.2, {{operationName}}:
diff --git a/source/includes/extracts-transactions.yaml b/source/includes/extracts-transactions.yaml
index ab1de4e5b4a..3c5a53db99a 100644
--- a/source/includes/extracts-transactions.yaml
+++ b/source/includes/extracts-transactions.yaml
@@ -485,7 +485,7 @@ content: |
If the transaction writes to multiple shards, then during the commit
attempt across the shards
- - Outside reads that use read concern :readconcern:`snapshot` or
+ - Outside reads that use read concern :readconcern:`"snapshot"` or
:readconcern:`"linearizable"`, or are part of causally consistent
sessions (i.e. include :ref:`afterClusterTime `)
wait for all writes of a transaction to be visible.
@@ -606,7 +606,9 @@ content: |
In MongoDB 4.2 and earlier, the operation must be run on an existing
collection.
- .. seealso:: :ref:`transactions-create-collections-indexes`
+ .. seealso::
+
+ :ref:`transactions-create-collections-indexes`
---
ref: transactions-insert-implicit-collection-creation
content: |
@@ -623,7 +625,9 @@ content: |
In MongoDB 4.4 and earlier, the operation must be run on an existing
collection.
- .. seealso:: :ref:`transactions-create-collections-indexes`
+ .. seealso::
+
+ :ref:`transactions-create-collections-indexes`
---
ref: transactions-explicit-ddl
@@ -637,6 +641,8 @@ content: |
concern :readconcern:`"local"`. If you specify a read concern level
other than :readconcern:`"local"`, the transaction fails.
- .. seealso:: :ref:`transactions-create-collections-indexes`
+ .. seealso::
+
+ :ref:`transactions-create-collections-indexes`
...
diff --git a/source/includes/extracts-views.yaml b/source/includes/extracts-views.yaml
index 186ae74f9ca..f68bc2673db 100644
--- a/source/includes/extracts-views.yaml
+++ b/source/includes/extracts-views.yaml
@@ -118,7 +118,7 @@ content: |
- :projection:`$`
- :projection:`$elemMatch`
- :projection:`$slice`
- - :projection:`$meta`
+ - :expression:`$meta`
---
ref: _views-unsupported-projection
content: |
@@ -150,7 +150,7 @@ inherit:
ref: _views-unsupported-projection
file: extracts-views.yaml
replacement:
- projection: ":projection:`$meta`"
+ projection: ":expression:`$meta`"
---
ref: views-collation-behavior
content: |
diff --git a/source/includes/fact-agg-memory-limit.rst b/source/includes/fact-agg-memory-limit.rst
index d835f256f5a..f77dd6a65a7 100644
--- a/source/includes/fact-agg-memory-limit.rst
+++ b/source/includes/fact-agg-memory-limit.rst
@@ -16,4 +16,7 @@ aggregation pipeline stages to write data to temporary files.
.. include:: /includes/extracts/4.2-changes-usedDisk.rst
-.. seealso:: :ref:`sort-memory-limit` and :ref:`group-memory-limit`.
+.. seealso::
+
+ :ref:`sort-memory-limit` and :ref:`group-memory-limit`.
+
diff --git a/source/includes/fact-atlas-banner.rst b/source/includes/fact-atlas-banner.rst
index 408bec4b5b3..008a16e2c11 100644
--- a/source/includes/fact-atlas-banner.rst
+++ b/source/includes/fact-atlas-banner.rst
@@ -1,8 +1,5 @@
-.. admonition:: MongoDB Atlas
- :class: note
+.. note:: MongoDB Atlas
- .. container::
-
- `MongoDB Atlas `_
- is a hosted MongoDB service option in the cloud which requires no
- installation overhead and offers a free tier to get started.
+ `MongoDB Atlas `_
+ is a hosted MongoDB service option in the cloud which requires no
+ installation overhead and offers a free tier to get started.
diff --git a/source/includes/fact-atlas-search-banner.rst b/source/includes/fact-atlas-search-banner.rst
index fc46272d1e5..9edcceed366 100644
--- a/source/includes/fact-atlas-search-banner.rst
+++ b/source/includes/fact-atlas-search-banner.rst
@@ -1,5 +1,5 @@
-.. admonition:: MongoDB Atlas Search
- :class: note
+.. note:: MongoDB Atlas Search
+
:atlas:`Atlas Search ` makes it easy to build fast,
relevance-based search capabilities on top of your MongoDB data. Try
diff --git a/source/includes/fact-bulk-operation-batches.rst b/source/includes/fact-bulk-operation-batches.rst
index 1bf08e06914..31129bfbc68 100644
--- a/source/includes/fact-bulk-operation-batches.rst
+++ b/source/includes/fact-bulk-operation-batches.rst
@@ -1,8 +1,8 @@
-Each group of operations can have at most :limit:`1000 operations `. If a group exceeds this :limit:`limit
-`, MongoDB will divide the group into
-smaller groups of 1000 or less. For example, if the bulk operations list
-consists of 2000 insert operations, MongoDB creates 2 groups, each with
-1000 operations.
+Each group of operations can have at most :limit:`1000 operations `. If a group exceeds this
+:limit:`limit `, MongoDB will divide
+the group into smaller groups of 1000 or less. For example, if the bulk
+operations list consists of 2000 insert operations, MongoDB creates 2
+groups, each with 1000 operations.
The sizes and grouping mechanics are internal performance details and
are subject to change in future versions.
diff --git a/source/includes/fact-bulkwrite-operation-batches.rst b/source/includes/fact-bulkwrite-operation-batches.rst
index ba64f975ef5..1ac92e29f53 100644
--- a/source/includes/fact-bulkwrite-operation-batches.rst
+++ b/source/includes/fact-bulkwrite-operation-batches.rst
@@ -4,7 +4,7 @@ the database. As of MongoDB 3.6, this value is ``100,000``.
This value is shown in the :data:`isMaster.maxWriteBatchSize` field.
This limit prevents issues with oversized error messages. If a group
-exceeds this :limit:`limit`,
+exceeds this :limit:`limit `,
the client driver divides the group into smaller groups with counts
less than or equal to the value of the limit. For example, with the
``maxWriteBatchSize`` value of ``100,000``, if the queue consists of
@@ -25,4 +25,4 @@ string. Currently, begins once there are at least 2 error messages with
total size greater than ``1MB``.
The sizes and grouping mechanics are internal performance details and
-are subject to change in future versions.
\ No newline at end of file
+are subject to change in future versions.
diff --git a/source/includes/fact-config-server-replica-set-restrictions.rst b/source/includes/fact-config-server-replica-set-restrictions.rst
index 088a319a20b..f685efd9636 100644
--- a/source/includes/fact-config-server-replica-set-restrictions.rst
+++ b/source/includes/fact-config-server-replica-set-restrictions.rst
@@ -7,5 +7,4 @@ for config servers:
`.
- Must build indexes (i.e. no member should have
- :data:`~replSetGetConfig.members[n].buildIndexes` setting set to
- false).
+ :rsconf:`members[n].buildIndexes` setting set to false).
diff --git a/source/includes/fact-document-max-size.rst b/source/includes/fact-document-max-size.rst
index 21bda658d97..df7d1d8a174 100644
--- a/source/includes/fact-document-max-size.rst
+++ b/source/includes/fact-document-max-size.rst
@@ -4,5 +4,5 @@ The maximum document size helps ensure that a single document cannot
use excessive amount of RAM or, during transmission, excessive amount
of bandwidth. To store documents larger than the maximum size, MongoDB
provides the GridFS API. See :binary:`~bin.mongofiles` and the
-documentation for your :ecosystem:`driver ` for more
+documentation for your :driver:`driver >` for more
information about GridFS.
diff --git a/source/includes/fact-download-mongo-shell.rst b/source/includes/fact-download-mongo-shell.rst
index 0954611b0da..53108a76a33 100644
--- a/source/includes/fact-download-mongo-shell.rst
+++ b/source/includes/fact-download-mongo-shell.rst
@@ -21,29 +21,27 @@ a standalone package by following these steps:
3. Select the :guilabel:`Package` to download according to your
platform:
- .. container::
+ .. list-table::
+ :header-rows: 1
+ :widths: 15 85
- .. list-table::
- :header-rows: 1
- :widths: 15 85
+ * - Platform
+ - Download Package
- * - Platform
- - Download Package
+ * - *Windows*
- * - *Windows*
+ - Select the ``zip`` package to download an archive which
+ includes the :binary:`~bin.mongo` shell.
- - Select the ``zip`` package to download an archive which
- includes the :binary:`~bin.mongo` shell.
+ * - *macOS*
- * - *macOS*
+ - Select the ``tgz`` package to download an archive which
+ includes the :binary:`~bin.mongo` shell.
- - Select the ``tgz`` package to download an archive which
- includes the :binary:`~bin.mongo` shell.
+ * - *Linux*
- * - *Linux*
-
- - Select the ``tgz`` package to download the
- :binary:`~bin.mongo` shell.
+ - Select the ``tgz`` package to download the
+ :binary:`~bin.mongo` shell.
4. Copy the :binary:`~bin.mongo` shell from the archive to a location on
your filesystem.
diff --git a/source/includes/fact-enterprise-only-admonition.rst b/source/includes/fact-enterprise-only-admonition.rst
index 139be75557c..6d1daf9c37b 100644
--- a/source/includes/fact-enterprise-only-admonition.rst
+++ b/source/includes/fact-enterprise-only-admonition.rst
@@ -1,3 +1,3 @@
-.. admonition:: Enterprise Feature
+.. note:: Enterprise Feature
Available in MongoDB Enterprise only.
diff --git a/source/includes/fact-explain-methods-differences.rst b/source/includes/fact-explain-methods-differences.rst
index cfd8fd9a85a..669bcedf2f7 100644
--- a/source/includes/fact-explain-methods-differences.rst
+++ b/source/includes/fact-explain-methods-differences.rst
@@ -1,12 +1,12 @@
-:method:`db.collection.explain().find()` is similar to
+:method:`db.collection.explain().find() ` is similar to
:method:`db.collection.find().explain() ` with the
following key differences:
-- The :method:`db.collection.explain().find()` construct allows for the
+- The :method:`db.collection.explain().find() ` construct allows for the
additional chaining of query modifiers. For list of query modifiers,
see :ref:`db.collection.explain().find().help() `.
-- The :method:`db.collection.explain().find()` returns a cursor, which
+- The :method:`db.collection.explain().find() ` returns a cursor, which
requires a call to ``.next()``, or its alias ``.finish()``, to return
the ``explain()`` results.
If run interactively in the :binary:`~bin.mongo` shell, the
diff --git a/source/includes/fact-log-slow-queries.rst b/source/includes/fact-log-slow-queries.rst
index ddec121c616..1514b50f1e7 100644
--- a/source/includes/fact-log-slow-queries.rst
+++ b/source/includes/fact-log-slow-queries.rst
@@ -1,16 +1,16 @@
.. COMMENT: When included as part of options/settings, this is used by mongod and configuration file and not mongos. For mongos, see options-mongos.yaml. This file is however included in other files where distinction between mongod/mongos is sufficient.
-When :setting:`~param.logLevel` is set to ``0``, MongoDB records *slow*
+When :parameter:`logLevel` is set to ``0``, MongoDB records *slow*
operations to the diagnostic log at a rate determined by
:setting:`~operationProfiling.slowOpSampleRate`. Starting in MongoDB
4.2, the secondaries of replica sets log :ref:`all oplog entry messages
that take longer than the slow operation threshold to apply
` regardless of the sample rate.
-At higher :setting:`~param.logLevel` settings, all operations appear in
+At higher :parameter:`logLevel` settings, all operations appear in
the diagnostic log regardless of their latency with the following
exception: the logging of :ref:`slow oplog entry messages by the
secondaries `. The secondaries log only the slow oplog
-entries; increasing the :setting:`~param.logLevel` does not log all
+entries; increasing the :parameter:`logLevel` does not log all
oplog entries.
\ No newline at end of file
diff --git a/source/includes/fact-meta-operator-disambiguation.rst b/source/includes/fact-meta-operator-disambiguation.rst
index b0ea6a55e6b..2acd4818746 100644
--- a/source/includes/fact-meta-operator-disambiguation.rst
+++ b/source/includes/fact-meta-operator-disambiguation.rst
@@ -1,4 +1,4 @@
-The behavior and requirements of the :projection:`$meta` projection
+The behavior and requirements of the :expression:`$meta` projection
operator differ from that of the :expression:`$meta` aggregation
operator. For details on the :expression:`$meta` aggregation operator,
see the :expression:`$meta` aggregation operator reference page.
diff --git a/source/includes/fact-mongo-shell-method-toc.rst b/source/includes/fact-mongo-shell-method-toc.rst
index 0202d69ab82..de9cbc54114 100644
--- a/source/includes/fact-mongo-shell-method-toc.rst
+++ b/source/includes/fact-mongo-shell-method-toc.rst
@@ -1,5 +1,5 @@
The methods listed on this table of contents page refer to the
:binary:`~bin.mongo` shell methods, and *not* to the MongoDB Node.js
driver (or any other driver) methods. For corresponding MongoDB driver
-API, refer to your specific :ecosystem:`MongoDB driver `
+API, refer to your specific :driver:`MongoDB driver >`
documentation instead.
diff --git a/source/includes/fact-mongo-shell-method.rst b/source/includes/fact-mongo-shell-method.rst
index 8b4989a81be..2320429354e 100644
--- a/source/includes/fact-mongo-shell-method.rst
+++ b/source/includes/fact-mongo-shell-method.rst
@@ -1,7 +1,7 @@
-.. admonition:: ``mongo`` Shell Method
- :class: important
+.. important:: ``mongo`` Shell Method
+
This page documents the :binary:`~bin.mongo` shell method, and does
*not* refer to the MongoDB Node.js driver (or any other driver)
method. For corresponding MongoDB driver API, refer to your specific
- :ecosystem:`MongoDB driver ` documentation instead.
+ :driver:`MongoDB driver >` documentation instead.
diff --git a/source/includes/fact-mws-intro.rst b/source/includes/fact-mws-intro.rst
new file mode 100644
index 00000000000..f0f7330978b
--- /dev/null
+++ b/source/includes/fact-mws-intro.rst
@@ -0,0 +1 @@
+You can run the operation in the web shell below:
diff --git a/source/includes/fact-mws.rst b/source/includes/fact-mws.rst
index 22dae3d8ba1..ac43e033852 100644
--- a/source/includes/fact-mws.rst
+++ b/source/includes/fact-mws.rst
@@ -1,3 +1,2 @@
-.. raw:: html
-
-
+.. mongo-web-shell::
+ :version: 4.2
diff --git a/source/includes/fact-olson-tz-behavior.rst b/source/includes/fact-olson-tz-behavior.rst
index 555c2460140..6a0d8df9a64 100644
--- a/source/includes/fact-olson-tz-behavior.rst
+++ b/source/includes/fact-olson-tz-behavior.rst
@@ -19,7 +19,6 @@ offset for the Olson Timezone Identifier. The example uses the
:expression:`$hour` and :expression:`$minute` operators to return the
corresponding portions of the ``date`` field:
-.. cssclass:: copyable-code
.. code-block:: javascript
db.sales.aggregate([
diff --git a/source/includes/fact-query-min-max.rst b/source/includes/fact-query-min-max.rst
index dbd46a76c04..2e234a461e0 100644
--- a/source/includes/fact-query-min-max.rst
+++ b/source/includes/fact-query-min-max.rst
@@ -1,7 +1,7 @@
-The :operator:`min` and :operator:`max` operators indicate that the system
+The :operator:`$min` and :operator:`$max` operators indicate that the system
should avoid normal query planning. Instead they construct an index scan where
the index bounds are explicitly specified by the values given in
-:operator:`min` and :operator:`max`.
+:operator:`$min` and :operator:`$max`.
.. warning::
diff --git a/source/includes/fact-replica-set-sync-prefers-non-hidden.rst b/source/includes/fact-replica-set-sync-prefers-non-hidden.rst
index 668f4df3cad..f18452ce963 100644
--- a/source/includes/fact-replica-set-sync-prefers-non-hidden.rst
+++ b/source/includes/fact-replica-set-sync-prefers-non-hidden.rst
@@ -7,4 +7,6 @@ resort. If you want a secondary to sync from a hidden member, use the
sync target. See the documentation for :dbcommand:`replSetSyncFrom`
before using the command.
-.. seealso:: :doc:`/tutorial/manage-chained-replication`
+.. seealso::
+
+ :doc:`/tutorial/manage-chained-replication`
diff --git a/source/includes/fact-rs-status-init-sync-availability.rst b/source/includes/fact-rs-status-init-sync-availability.rst
index c66e5b38c67..9d3719845c4 100644
--- a/source/includes/fact-rs-status-init-sync-availability.rst
+++ b/source/includes/fact-rs-status-init-sync-availability.rst
@@ -1,5 +1,5 @@
-.. admonition:: Availability
- :class: important
+.. important:: Availability
+
Starting in MongoDB 4.2.1,
:data:`replSetGetStatus.initialSyncStatus` metrics are only
diff --git a/source/includes/fact-selinux-redhat-options.rst b/source/includes/fact-selinux-redhat-options.rst
index 4b20bd4d2b2..b3a0cfcb395 100644
--- a/source/includes/fact-selinux-redhat-options.rst
+++ b/source/includes/fact-selinux-redhat-options.rst
@@ -6,50 +6,48 @@
Permit Access to ``cgroup``
+++++++++++++++++++++++++++
-.. container::
-
- The current SELinux Policy does not allow the MongoDB process to
- access ``/sys/fs/cgroup``, which is required to determine
- the available memory on your system. If you intend to run SELinux in
- ``enforcing`` mode, you will need to make the following adjustment
- to your SELinux policy:
+The current SELinux Policy does not allow the MongoDB process to
+access ``/sys/fs/cgroup``, which is required to determine
+the available memory on your system. If you intend to run SELinux in
+``enforcing`` mode, you will need to make the following adjustment
+to your SELinux policy:
- #. Ensure your system has the ``checkpolicy`` package installed:
+#. Ensure your system has the ``checkpolicy`` package installed:
- .. code-block:: sh
+ .. code-block:: sh
- sudo yum install checkpolicy
+ sudo yum install checkpolicy
- #. Create a custom policy file :file:`mongodb_cgroup_memory.te`:
+#. Create a custom policy file :file:`mongodb_cgroup_memory.te`:
- .. code-block:: sh
+ .. code-block:: sh
- cat > mongodb_cgroup_memory.te < mongodb_cgroup_memory.te <
+ sudo semanage fcontext -a -t
- where specify one of the following types as appropriate:
+ where specify one of the following types as appropriate:
- - ``mongod_var_lib_t`` for data directory
+ - ``mongod_var_lib_t`` for data directory
- - ``mongod_log_t`` for log file directory
+ - ``mongod_log_t`` for log file directory
- - ``mongod_var_run_t`` for pid file directory
+ - ``mongod_var_run_t`` for pid file directory
- .. note::
+ .. note::
- Be sure to include the ``.*`` at the end of the directory.
+ Be sure to include the ``.*`` at the end of the directory.
- #. Update the SELinux user policy for the new directory:
+#. Update the SELinux user policy for the new directory:
- .. code-block:: sh
+ .. code-block:: sh
- sudo chcon -Rv -u system_u -t
+ sudo chcon -Rv -u system_u -t
- where specify one of the following types as appropriate:
+ where specify one of the following types as appropriate:
- - ``mongod_var_lib_t`` for data directory
+ - ``mongod_var_lib_t`` for data directory
- - ``mongod_log_t`` for log directory
+ - ``mongod_log_t`` for log directory
- - ``mongod_var_run_t`` for pid file directory
+ - ``mongod_var_run_t`` for pid file directory
- #. Apply the updated SELinux policies to the directory:
+#. Apply the updated SELinux policies to the directory:
- .. code-block:: sh
+ .. code-block:: sh
- restorecon -R -v
+ restorecon -R -v
- For example:
+For example:
- .. tip::
+.. tip::
- Be sure to include the ``.*`` at the end of the directory for the
- ``semanage fcontext`` operations.
+ Be sure to include the ``.*`` at the end of the directory for the
+ ``semanage fcontext`` operations.
- - If using a non-default MongoDB data path of ``/mongodb/data``:
+- If using a non-default MongoDB data path of ``/mongodb/data``:
- .. code-block:: sh
+ .. code-block:: sh
- sudo semanage fcontext -a -t mongod_var_lib_t '/mongodb/data.*'
- sudo chcon -Rv -u system_u -t mongod_var_lib_t '/mongodb/data'
- restorecon -R -v '/mongodb/data'
+ sudo semanage fcontext -a -t mongod_var_lib_t '/mongodb/data.*'
+ sudo chcon -Rv -u system_u -t mongod_var_lib_t '/mongodb/data'
+ restorecon -R -v '/mongodb/data'
- - If using a non-default MongoDB log directory of ``/mongodb/log``
- (e.g. if the log file path is ``/mongodb/log/mongod.log``):
+- If using a non-default MongoDB log directory of ``/mongodb/log``
+ (e.g. if the log file path is ``/mongodb/log/mongod.log``):
- .. code-block:: sh
+ .. code-block:: sh
- sudo semanage fcontext -a -t mongod_log_t '/mongodb/log.*'
- sudo chcon -Rv -u system_u -t mongod_log_t '/mongodb/log'
- restorecon -R -v '/mongodb/log'
+ sudo semanage fcontext -a -t mongod_log_t '/mongodb/log.*'
+ sudo chcon -Rv -u system_u -t mongod_log_t '/mongodb/log'
+ restorecon -R -v '/mongodb/log'
Using a Custom MongoDB Port
+++++++++++++++++++++++++++
-.. container::
-
- .. code-block:: sh
+.. code-block:: sh
- sudo semanage port -a -t mongod_port_t -p tcp
+ sudo semanage port -a -t mongod_port_t -p tcp
diff --git a/source/includes/fact-snmp-run-mongodb-as-snmp-master.rst b/source/includes/fact-snmp-run-mongodb-as-snmp-master.rst
index 8c15c779152..7389f2e0b87 100644
--- a/source/includes/fact-snmp-run-mongodb-as-snmp-master.rst
+++ b/source/includes/fact-snmp-run-mongodb-as-snmp-master.rst
@@ -1,4 +1,5 @@
-You can run |mongod-program| with the :setting:`snmp-master`
-option for testing purposes. To do this, use the SNMP master
-configuration file instead of the subagent configuration file. From
-the directory containing the unpacked MongoDB installation files:
+You can run |mongod-program| with the
+:option:`snmp-master ` option for testing
+purposes. To do this, use the SNMP master configuration file instead of
+the subagent configuration file. From the directory containing the
+unpacked MongoDB installation files:
diff --git a/source/includes/fact-sparse-index-hint-count.rst b/source/includes/fact-sparse-index-hint-count.rst
index 98325edf1be..09ef941daa7 100644
--- a/source/includes/fact-sparse-index-hint-count.rst
+++ b/source/includes/fact-sparse-index-hint-count.rst
@@ -1,4 +1,4 @@
-If you include a :method:`~db.cursor.hint()` that specifies a
+If you include a :method:`~cursor.hint()` that specifies a
:ref:`sparse index ` when you perform a
:method:`~cursor.count()` of all documents in a collection (i.e. with
an empty query predicate), the sparse index is used even if the sparse
@@ -11,7 +11,7 @@ index results in an incorrect count.
db.collection.find().hint( { x: 1 } ).count();
-To obtain the correct count, do not :method:`~db.cursor.hint()` with a
+To obtain the correct count, do not :method:`~cursor.hint()` with a
:ref:`sparse index ` when performing a count of all
documents in a collection.
diff --git a/source/includes/fact-support.rst b/source/includes/fact-support.rst
index 2a08d941d06..33a22085c1b 100644
--- a/source/includes/fact-support.rst
+++ b/source/includes/fact-support.rst
@@ -1,27 +1,21 @@
MongoDB Community
~~~~~~~~~~~~~~~~~
-.. container::
-
- For questions, discussions, or general technical support, visit the
- `MongoDB Community Forums
- `_.
- The MongoDB Community Forums are a centralized place to connect with
- other MongoDB users, ask questions, and get answers.
+For questions, discussions, or general technical support, visit the
+`MongoDB Community Forums
+`_.
+The MongoDB Community Forums are a centralized place to connect with
+other MongoDB users, ask questions, and get answers.
MongoDB Atlas or Cloud Manager
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. container::
-
- For technical support questions, please log into your `MongoDB Cloud
- account `_ and open a
- support ticket.
+For technical support questions, please log into your `MongoDB Cloud
+account `_ and open a
+support ticket.
MongoDB Enterprise or Ops Manager
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. container::
-
- For technical support questions, please file a ticket through the
- `MongoDB Support Portal `_.
+For technical support questions, please file a ticket through the
+`MongoDB Support Portal `_.
diff --git a/source/includes/fact-systemd-vs-initd.rst b/source/includes/fact-systemd-vs-initd.rst
index 252285e8a98..2a07cea3501 100644
--- a/source/includes/fact-systemd-vs-initd.rst
+++ b/source/includes/fact-systemd-vs-initd.rst
@@ -7,11 +7,9 @@ the ``service`` command).
If you are unsure which init system your platform uses, run the
following command:
-.. container::
+.. code-block:: sh
- .. code-block:: sh
-
- ps --no-headers -o comm 1
+ ps --no-headers -o comm 1
Then select the appropriate tab below based on the result:
diff --git a/source/includes/fact-tcp-keepalive-linux.rst b/source/includes/fact-tcp-keepalive-linux.rst
index 6a39e5f7aab..7e4261303c5 100644
--- a/source/includes/fact-tcp-keepalive-linux.rst
+++ b/source/includes/fact-tcp-keepalive-linux.rst
@@ -1,48 +1,44 @@
- To view the keepalive setting on Linux, use one of the following
commands:
- .. container::
+ .. code-block:: sh
- .. code-block:: sh
+ sysctl net.ipv4.tcp_keepalive_time
- sysctl net.ipv4.tcp_keepalive_time
+ Or:
- Or:
+ .. code-block:: sh
- .. code-block:: sh
+ cat /proc/sys/net/ipv4/tcp_keepalive_time
- cat /proc/sys/net/ipv4/tcp_keepalive_time
+ The value is measured in seconds.
- The value is measured in seconds.
+ .. note::
- .. note::
-
- Although the setting name includes ``ipv4``, the
- ``tcp_keepalive_time`` value applies to both IPv4 and IPv6.
+ Although the setting name includes ``ipv4``, the
+ ``tcp_keepalive_time`` value applies to both IPv4 and IPv6.
- To change the ``tcp_keepalive_time`` value, you can use one of the
following commands, supplying a ** in seconds:
- .. container::
-
- .. code-block:: sh
+ .. code-block:: sh
- sudo sysctl -w net.ipv4.tcp_keepalive_time=
+ sudo sysctl -w net.ipv4.tcp_keepalive_time=
- Or:
+ Or:
- .. code-block:: sh
+ .. code-block:: sh
- echo | sudo tee /proc/sys/net/ipv4/tcp_keepalive_time
+ echo | sudo tee /proc/sys/net/ipv4/tcp_keepalive_time
- These operations do not persist across system reboots. To persist
- the setting, add the following line to ``/etc/sysctl.conf``,
- supplying a ** in seconds, and reboot the machine:
+ These operations do not persist across system reboots. To persist
+ the setting, add the following line to ``/etc/sysctl.conf``,
+ supplying a ** in seconds, and reboot the machine:
- .. code-block:: sh
+ .. code-block:: sh
- net.ipv4.tcp_keepalive_time =
+ net.ipv4.tcp_keepalive_time =
- Keepalive values greater than ``300`` seconds,
- (5 minutes) will be overridden on :binary:`~bin.mongod` and
- :binary:`~bin.mongos` sockets and set to ``300`` seconds.
+ Keepalive values greater than ``300`` seconds,
+ (5 minutes) will be overridden on :binary:`~bin.mongod` and
+ :binary:`~bin.mongos` sockets and set to ``300`` seconds.
diff --git a/source/includes/fact-text-index-weight.rst b/source/includes/fact-text-index-weight.rst
index 2e90280b9f5..d887bb95c42 100644
--- a/source/includes/fact-text-index-weight.rst
+++ b/source/includes/fact-text-index-weight.rst
@@ -4,7 +4,7 @@ of the text search score.
For each indexed field in the document, MongoDB multiplies the number
of matches by the weight and sums the results. Using this sum, MongoDB
-then calculates the score for the document. See :projection:`$meta`
+then calculates the score for the document. See :expression:`$meta`
operator for details on returning and sorting by text scores.
The default weight is 1 for the indexed fields. To adjust the weights
diff --git a/source/includes/fact-timezone-description.rst b/source/includes/fact-timezone-description.rst
index 9bb6393c01b..77a12b5033a 100644
--- a/source/includes/fact-timezone-description.rst
+++ b/source/includes/fact-timezone-description.rst
@@ -13,17 +13,17 @@ If no ``timezone`` is provided, the result is displayed in ``UTC``.
* - ``Format``
- ``Examples``
- * - `Olson Timezone Identifier`
+ * - ``Olson Timezone Identifier``
- - ::
+ - .. code-block:: none
"America/New_York"
"Europe/London"
"GMT"
- * - `UTC Offset`
+ * - ``UTC Offset``
- - ::
+ - .. code-block:: none
+/-[hh]:[mm], e.g. "+04:45"
+/-[hh][mm], e.g. "-0530"
diff --git a/source/includes/in-dev.rst b/source/includes/in-dev.rst
index 351fba776ec..e15d5c9af0b 100644
--- a/source/includes/in-dev.rst
+++ b/source/includes/in-dev.rst
@@ -1,6 +1,6 @@
-.. admonition:: MongoDB {+version-dev+} Release Candidates
- :class: warning
+.. warning:: MongoDB {+version-dev+} Release Candidates
+
While the {+version-dev+} release candidates are available, these versions of
MongoDB are for **testing purposes only and not for production use**.
diff --git a/source/includes/limits-sharding-unique-indexes.rst b/source/includes/limits-sharding-unique-indexes.rst
index 161a3483307..f9ffcb94911 100644
--- a/source/includes/limits-sharding-unique-indexes.rst
+++ b/source/includes/limits-sharding-unique-indexes.rst
@@ -3,6 +3,8 @@ the unique index contains the full shard key as a prefix of the
index. In these situations MongoDB will enforce uniqueness across
the full key, not a single field.
-.. see:: :ref:`shard-key-arbitrary-uniqueness`
+.. see::
+
+ :ref:`shard-key-arbitrary-uniqueness`
for an alternate approach.
diff --git a/source/includes/list-mongodb-enterprise-packages.rst b/source/includes/list-mongodb-enterprise-packages.rst
index 577276ee798..f078aa6aa3f 100644
--- a/source/includes/list-mongodb-enterprise-packages.rst
+++ b/source/includes/list-mongodb-enterprise-packages.rst
@@ -1,61 +1,59 @@
MongoDB Enterprise Edition is available from its own dedicated
repository, and contains the following officially-supported packages:
-.. container::
+.. list-table::
+ :header-rows: 1
+ :widths: 35 65
- .. list-table::
- :header-rows: 1
- :widths: 35 65
+ * - Package Name
+ - Description
- * - Package Name
- - Description
+ * - ``{+package-name-enterprise+}``
+ - A ``metapackage`` that automatically installs the component
+ packages listed below.
- * - ``{+package-name-enterprise+}``
- - A ``metapackage`` that automatically installs the component
- packages listed below.
+ * - ``{+package-name-enterprise+}-server``
+ - Contains the :binary:`~bin.mongod` daemon and associated
+ configuration and init scripts.
- * - ``{+package-name-enterprise+}-server``
- - Contains the :binary:`~bin.mongod` daemon and associated
- configuration and init scripts.
+ * - ``{+package-name-enterprise+}-mongos``
+ - Contains the :binary:`~bin.mongos` daemon.
- * - ``{+package-name-enterprise+}-mongos``
- - Contains the :binary:`~bin.mongos` daemon.
+ * - ``{+package-name-enterprise+}-shell``
+ - Contains the :binary:`~bin.mongo` shell.
- * - ``{+package-name-enterprise+}-shell``
- - Contains the :binary:`~bin.mongo` shell.
+ * - ``{+package-name-enterprise+}-cryptd``
+ - Contains the :ref:`mongocryptd `
+ binary
- * - ``{+package-name-enterprise+}-cryptd``
- - Contains the :ref:`mongocryptd `
- binary
+ * - ``{+package-name-enterprise+}-tools``
+ - A ``metapackage`` that automatically installs the component
+ packages listed below:
- * - ``{+package-name-enterprise+}-tools``
- - A ``metapackage`` that automatically installs the component
- packages listed below:
+ .. list-table::
+ :header-rows: 1
+ :widths: 50 50
- .. list-table::
- :header-rows: 1
- :widths: 50 50
+ * - Package Name
+ - Description
- * - Package Name
- - Description
+ * - ``mongodb-database-tools``
+ - Contains the following MongoDB database tools:
- * - ``mongodb-database-tools``
- - Contains the following MongoDB database tools:
+ - :binary:`~bin.mongodump`
+ - :binary:`~bin.mongorestore`
+ - :binary:`~bin.bsondump`
+ - :binary:`~bin.mongoimport`
+ - :binary:`~bin.mongoexport`
+ - :binary:`~bin.mongostat`
+ - :binary:`~bin.mongotop`
+ - :binary:`~bin.mongofiles`
- - :binary:`~bin.mongodump`
- - :binary:`~bin.mongorestore`
- - :binary:`~bin.bsondump`
- - :binary:`~bin.mongoimport`
- - :binary:`~bin.mongoexport`
- - :binary:`~bin.mongostat`
- - :binary:`~bin.mongotop`
- - :binary:`~bin.mongofiles`
+ * - ``{+package-name-enterprise+}-database-tools-extra``
+ - Contains the following MongoDB support tools:
- * - ``{+package-name-enterprise+}-database-tools-extra``
- - Contains the following MongoDB support tools:
-
- - :binary:`~bin.mongoldap`
- - :binary:`~bin.mongokerberos`
- - :ref:`install-compass` script
- - ``mongodecrypt`` binary
+ - :binary:`~bin.mongoldap`
+ - :binary:`~bin.mongokerberos`
+ - :ref:`install-compass` script
+ - ``mongodecrypt`` binary
diff --git a/source/includes/list-mongodb-org-packages.rst b/source/includes/list-mongodb-org-packages.rst
index ab0d2e80e7e..9a4f6446994 100644
--- a/source/includes/list-mongodb-org-packages.rst
+++ b/source/includes/list-mongodb-org-packages.rst
@@ -4,56 +4,54 @@
MongoDB Community Edition is available from its own dedicated
repository, and contains the following officially-supported packages:
-.. container::
-
- .. list-table::
- :header-rows: 1
- :widths: 25 75
-
- * - Package Name
- - Description
-
- * - ``{+package-name-org+}``
- - A ``metapackage`` that automatically installs the component
- packages listed below.
-
- * - ``{+package-name-org+}-server``
-
- - Contains the :binary:`~bin.mongod` daemon, associated init
- script, and a :ref:`configuration file
- ` (``/etc/mongod.conf``). You
- can use the initialization script to start :binary:`~bin.mongod`
- with the configuration file. For details, see `Run MongoDB
- Community Edition`_.
-
- * - ``{+package-name-org+}-mongos``
- - Contains the :binary:`~bin.mongos` daemon.
-
- * - ``{+package-name-org+}-shell``
- - Contains the :binary:`~bin.mongo` shell.
-
- * - ``{+package-name-org+}-tools``
- - A ``metapackage`` that automatically installs the component
- packages listed below:
-
- .. list-table::
- :header-rows: 1
- :widths: 50 50
-
- * - Package Name
- - Description
-
- * - ``mongodb-database-tools``
- - Contains the following MongoDB database tools:
-
- - :binary:`~bin.mongodump`
- - :binary:`~bin.mongorestore`
- - :binary:`~bin.bsondump`
- - :binary:`~bin.mongoimport`
- - :binary:`~bin.mongoexport`
- - :binary:`~bin.mongostat`
- - :binary:`~bin.mongotop`
- - :binary:`~bin.mongofiles`
-
- * - ``{+package-name-org+}-database-tools-extra``
- - Contains the :ref:`install-compass` script
+.. list-table::
+ :header-rows: 1
+ :widths: 25 75
+
+ * - Package Name
+ - Description
+
+ * - ``{+package-name-org+}``
+ - A ``metapackage`` that automatically installs the component
+ packages listed below.
+
+ * - ``{+package-name-org+}-server``
+
+ - Contains the :binary:`~bin.mongod` daemon, associated init
+ script, and a :ref:`configuration file
+ ` (``/etc/mongod.conf``). You
+ can use the initialization script to start :binary:`~bin.mongod`
+ with the configuration file. For details, see `Run MongoDB
+ Community Edition`_.
+
+ * - ``{+package-name-org+}-mongos``
+ - Contains the :binary:`~bin.mongos` daemon.
+
+ * - ``{+package-name-org+}-shell``
+ - Contains the :binary:`~bin.mongo` shell.
+
+ * - ``{+package-name-org+}-tools``
+ - A ``metapackage`` that automatically installs the component
+ packages listed below:
+
+ .. list-table::
+ :header-rows: 1
+ :widths: 50 50
+
+ * - Package Name
+ - Description
+
+ * - ``mongodb-database-tools``
+ - Contains the following MongoDB database tools:
+
+ - :binary:`~bin.mongodump`
+ - :binary:`~bin.mongorestore`
+ - :binary:`~bin.bsondump`
+ - :binary:`~bin.mongoimport`
+ - :binary:`~bin.mongoexport`
+ - :binary:`~bin.mongostat`
+ - :binary:`~bin.mongotop`
+ - :binary:`~bin.mongofiles`
+
+ * - ``{+package-name-org+}-database-tools-extra``
+ - Contains the :ref:`install-compass` script
diff --git a/source/includes/list-table-3.0-driver-compatibility.rst b/source/includes/list-table-3.0-driver-compatibility.rst
index c0eb0ebdfeb..e3420c82239 100644
--- a/source/includes/list-table-3.0-driver-compatibility.rst
+++ b/source/includes/list-table-3.0-driver-compatibility.rst
@@ -6,39 +6,38 @@
- Driver Language
- |driver-compatibility-heading|
- * - :ecosystem:`C `
+ * - :driver:`C `
- `1.1.0 `_
- - :ecosystem:`Perl `
+ - :driver:`Perl `
- `1.0.0 `__
* - `C++ `_
- `1.0.0 `__
- - :ecosystem:`PHP `
+ - :driver:`PHP `
- `1.0 `_
- * - :ecosystem:`C# `
+ * - :driver:`C# `
- `1.10 `_
- - :ecosystem:`Python `
+ - :driver:`Python `
- `2.8 `_
- * - :ecosystem:`Java `
+ * - :driver:`Java `
- `2.13 `_
- - :ecosystem:`Motor `
+ - :driver:`Motor `
- `0.4 `_
- * - :ecosystem:`Node.js `
+ * - :driver:`Node.js `
- `1.4.29 `_
-
- - :ecosystem:`Ruby `
+ - :driver:`Ruby `
- `1.12 `_
* -
-
- - :ecosystem:`Scala `
+ - :driver:`Scala `
- `2.8.0 `_
diff --git a/source/includes/list-text-search-restrictions-in-agg.rst b/source/includes/list-text-search-restrictions-in-agg.rst
index 0fec4572c51..78c6ddb4de5 100644
--- a/source/includes/list-text-search-restrictions-in-agg.rst
+++ b/source/includes/list-text-search-restrictions-in-agg.rst
@@ -1,9 +1,9 @@
- The :pipeline:`$match` stage that includes a :query:`$text` must be
the **first** stage in the pipeline.
-- A :query:`text` operator can only occur once in the stage.
+- A :query:`$text` operator can only occur once in the stage.
-- The :query:`text` operator expression cannot appear in
+- The :query:`$text` operator expression cannot appear in
:expression:`$or` or :expression:`$not` expressions.
- The text search, by default, does not return the matching documents
diff --git a/source/includes/note-deb-and-rpm-default-to-localhost.rst b/source/includes/note-deb-and-rpm-default-to-localhost.rst
index 983384c25fd..bb5fbd21294 100644
--- a/source/includes/note-deb-and-rpm-default-to-localhost.rst
+++ b/source/includes/note-deb-and-rpm-default-to-localhost.rst
@@ -4,5 +4,5 @@
|mongodb-package| installed from official :doc:`.deb
` and :doc:`.rpm
` packages
-have the :setting:`bind_ip` configuration set to ``127.0.0.1`` by
+have the ``bind_ip`` configuration set to ``127.0.0.1`` by
default.
diff --git a/source/includes/stepdown-intro.rst b/source/includes/stepdown-intro.rst
index 444c3bcf39a..02133883992 100644
--- a/source/includes/stepdown-intro.rst
+++ b/source/includes/stepdown-intro.rst
@@ -3,7 +3,7 @@ Instructs the :term:`primary` of the replica set to become a
hold an :ref:`election for primary `.
The |command-method| does not immediately step down the primary. If no
-:data:`electable <~replSetGetConfig.members[n].priority>` secondaries
+:rsconf:`electable ` secondaries
are up to date with the primary, the primary waits up to
``secondaryCatchUpPeriodSecs`` (by default 10 seconds) for a
secondary to catch up. Once an electable secondary is
diff --git a/source/includes/steps-2.6-downgrade-authorization-prereq.yaml b/source/includes/steps-2.6-downgrade-authorization-prereq.yaml
index ccc35375252..a13e9ca8598 100644
--- a/source/includes/steps-2.6-downgrade-authorization-prereq.yaml
+++ b/source/includes/steps-2.6-downgrade-authorization-prereq.yaml
@@ -13,7 +13,7 @@ title:
stepnum: 2
ref: create-role-with-required-privileges
pre: |
- Using the :method:`db.createRole` method, create a
+ Using the :method:`db.createRole()` method, create a
:ref:`role ` with the required privileges.
action:
language: javascript
diff --git a/source/includes/steps-2.6-upgrade-authorization.yaml b/source/includes/steps-2.6-upgrade-authorization.yaml
index 253328c0c69..73d2bd347f4 100644
--- a/source/includes/steps-2.6-upgrade-authorization.yaml
+++ b/source/includes/steps-2.6-upgrade-authorization.yaml
@@ -15,7 +15,7 @@ title:
ref: upgrade-authz-schema
stepnum: 2
pre: |
- Use the :dbcommand:`authSchemaUpgrade` command in the ``admin``
+ Use the ``authSchemaUpgrade`` command in the ``admin``
database to update the user data using the :binary:`~bin.mongo` shell.
action:
- heading:
@@ -26,12 +26,12 @@ action:
db.adminCommand({authSchemaUpgrade: 1 });
post: |
In case of error, you may safely rerun the
- :dbcommand:`authSchemaUpgrade` command.
+ ``authSchemaUpgrade`` command.
- heading:
text: Sharded cluster ``authSchemaUpgrade`` consideration.
character: "'"
pre: |
- For a sharded cluster, :dbcommand:`authSchemaUpgrade` will
+ For a sharded cluster, ``authSchemaUpgrade`` will
upgrade the authorization data of the shards as well and the
upgrade is complete. You can, however, override this behavior by
including ``upgradeShards: false`` in the command, as in the
@@ -42,7 +42,7 @@ action:
upgradeShards: false });
post: |
If you override the behavior, after running
- :dbcommand:`authSchemaUpgrade` on a :binary:`~bin.mongos` instance,
+ ``authSchemaUpgrade`` on a :binary:`~bin.mongos` instance,
you will need to connect to the primary for each shard and
repeat the upgrade process after upgrading on the
:binary:`~bin.mongos`.
diff --git a/source/includes/steps-3.0-upgrade-mongodb-cr-to-scram.yaml b/source/includes/steps-3.0-upgrade-mongodb-cr-to-scram.yaml
index ed176b719a1..b0f6bab0e3e 100644
--- a/source/includes/steps-3.0-upgrade-mongodb-cr-to-scram.yaml
+++ b/source/includes/steps-3.0-upgrade-mongodb-cr-to-scram.yaml
@@ -28,11 +28,11 @@ action:
db.adminCommand({authSchemaUpgrade: 1});
post: |
In case of error, you may safely rerun the
- :dbcommand:`authSchemaUpgrade` command.
+ ``authSchemaUpgrade`` command.
- heading: Sharded cluster ``authSchemaUpgrade`` consideration.
pre: |
For a sharded cluster *without* :ref:`shard local users
- `, :dbcommand:`authSchemaUpgrade` will, by
+ `, ``authSchemaUpgrade`` will, by
default, upgrade the authorization data of the shards as well,
completing the upgrade.
@@ -46,7 +46,7 @@ action:
);
post: |
If you override the default behavior or your cluster has shard
- local users, after running :dbcommand:`authSchemaUpgrade` on a
+ local users, after running ``authSchemaUpgrade`` on a
:binary:`~bin.mongos` instance, you will need to connect to the
primary for each shard and repeat the upgrade process after
upgrading on the :binary:`~bin.mongos`.
diff --git a/source/includes/steps-3.6-upgrade-sharded-cluster.yaml b/source/includes/steps-3.6-upgrade-sharded-cluster.yaml
index cfa4eab505b..78061ccbc6d 100644
--- a/source/includes/steps-3.6-upgrade-sharded-cluster.yaml
+++ b/source/includes/steps-3.6-upgrade-sharded-cluster.yaml
@@ -7,8 +7,6 @@ content: |
the sharded cluster, and run :method:`sh.stopBalancer()` to
disable the balancer:
- .. cssclass:: copyable-code
-
.. code-block:: javascript
sh.stopBalancer()
@@ -24,8 +22,6 @@ content: |
:method:`sh.getBalancerState()`, which returns false if the balancer
is disabled:
- .. cssclass:: copyable-code
-
.. code-block:: javascript
sh.getBalancerState()
@@ -50,7 +46,6 @@ content: |-
.. include:: /includes/fact-bind-ip-sharded-clusters.rst
- .. cssclass:: copyable-code
.. code-block:: sh
mongod --configsvr --replSet --port --dbpath --bind_ip localhost,
@@ -62,7 +57,6 @@ content: |-
:setting:`net.port`, and :setting:`net.bindIp`,
then start the |newversion| binary:
- .. cssclass:: copyable-code
.. code-block:: yaml
sharding:
@@ -89,7 +83,6 @@ content: |-
:method:`rs.stepDown()` to step down the primary and force an
election of a new primary:
- .. cssclass:: copyable-code
.. code-block:: javascript
rs.stepDown()
@@ -104,7 +97,6 @@ content: |-
options. Include any optional command line options used by the
previous deployment:
- .. cssclass:: copyable-code
.. code-block:: sh
mongod --configsvr --replSet --port --dbpath --bind_ip localhost,
@@ -118,7 +110,6 @@ content: |-
:setting:`net.port`, and :setting:`net.bindIp`,
then start the |newversion| binary:
- .. cssclass:: copyable-code
.. code-block:: yaml
sharding:
@@ -152,7 +143,6 @@ content: |-
options. Include any optional command line options used by the
previous deployment:
- .. cssclass:: copyable-code
.. code-block:: sh
mongod --shardsvr --replSet --port --dbpath --bind_ip localhost,
@@ -165,7 +155,6 @@ content: |-
:setting:`replication.replSetName`, :setting:`net.port`, and
:setting:`net.bindIp`, then start the |newversion| binary:
- .. cssclass:: copyable-code
.. code-block:: yaml
sharding:
@@ -193,7 +182,6 @@ content: |-
:method:`rs.stepDown()` to step down the primary and force an
election of a new primary:
- .. cssclass:: copyable-code
.. code-block:: javascript
rs.stepDown()
@@ -210,7 +198,6 @@ content: |-
options. Include any optional command line options used by the
previous deployment:
- .. cssclass:: copyable-code
.. code-block:: sh
mongod --shardsvr --replSet --port --dbpath --bind_ip localhost,
@@ -224,7 +211,6 @@ content: |-
:setting:`net.port`, and :setting:`net.bindIp`, then start the
|newversion| binary:
- .. cssclass:: copyable-code
.. code-block:: yaml
sharding:
@@ -249,7 +235,6 @@ content: |-
.. include:: /includes/fact-bind-ip-sharded-clusters.rst
- .. cssclass:: copyable-code
.. code-block:: sh
mongos --configdb csReplSet/,, --bind_ip localhost,
@@ -263,7 +248,6 @@ content: |-
:binary:`~bin.mongos` in the cluster and run
:method:`sh.setBalancerState()` to re-enable the balancer:
- .. cssclass:: copyable-code
.. code-block:: javascript
sh.setBalancerState(true)
diff --git a/source/includes/steps-change-own-password-and-custom-data-prereq.yaml b/source/includes/steps-change-own-password-and-custom-data-prereq.yaml
index cfa879b630c..8441d398af6 100644
--- a/source/includes/steps-change-own-password-and-custom-data-prereq.yaml
+++ b/source/includes/steps-change-own-password-and-custom-data-prereq.yaml
@@ -19,7 +19,7 @@ stepnum: 2
title: Create a role with appropriate privileges.
ref: create-role
pre: |
- In the ``admin`` database, :method:`create ` a new
+ In the ``admin`` database, :method:`create ` a new
role with :authaction:`changeOwnPassword` and
:authaction:`changeOwnCustomData`.
action:
@@ -42,7 +42,7 @@ stepnum: 3
title: Add a user with this role.
ref: add-user
pre: |
- In the ``test`` database, :method:`create ` a new user with
+ In the ``test`` database, :method:`create ` a new user with
the created ``"changeOwnPasswordCustomDataRole"`` role. For example, the following
operation creates a user with both the built-in role :authrole:`readWrite` and
the user-created ``"changeOwnPasswordCustomDataRole"``.
diff --git a/source/includes/steps-compass-manual-queries.yaml b/source/includes/steps-compass-manual-queries.yaml
index 0f0e9adedbd..cec87ce5ace 100644
--- a/source/includes/steps-compass-manual-queries.yaml
+++ b/source/includes/steps-compass-manual-queries.yaml
@@ -10,6 +10,7 @@ action:
"JFK".
.. figure:: /images/compass/manual-query.png
+ :alt: Compass query bar with query entered
When a valid query is entered, the bar is colored green and can be
executed. Invalid queries are colored red. The UI will automatically update
@@ -27,6 +28,7 @@ action:
matching documents.
.. figure:: /images/compass/manual-query-results.png
+ :alt: Compass Apply button executes query
To clear a query, use the Reset button.
...
diff --git a/source/includes/steps-compass-query-builder.yaml b/source/includes/steps-compass-query-builder.yaml
deleted file mode 100644
index 845594e6e54..00000000000
--- a/source/includes/steps-compass-query-builder.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
-title: Select values from charts
-level: 4
-ref: select-values
-action:
- pre: |
- Charts in Compass are fully interactive. Clicking on a chart value or bar
- will automatically build a MongoDB query that matches the documents
- pertaining to that section of the chart.
-
- In the example below, clicking on the "JFK" bar builds a query matching all
- documents whose ``departureAirportFsCode`` field matches "JFK".
-
- .. figure:: /images/compass/query-builder-jfk.png
-
- Clicking on other field values adds them to the selection, creating a more
- complex query.
-
- Continuing with the example, this selects a particular ``flightId`` in
- addition to departures from JFK Airport.
-
- .. figure:: /images/compass/query-builder-jfk-flight-code.png
-
- To select multiple values within the same field, click and drag the mouse
- over a selection of values. Alternatively, hold the Shift key while
- selecting the desired values.
-
- .. figure:: /images/compass/query-builder-multi-select.png
-
- To deselect a previously-selected value, hold the Shift key while clicking
- on the selection.
-
- .. figure:: /images/compass/query-builder-deselect.png
----
-title: Apply the query
-level: 4
-ref: apply
-action:
- pre: |
- After building a query, run it by clicking the Apply button. To clear the
- query, use the Reset button.
-
- Note that composing "OR" queries is **not yet possible** with the automatic
- query builder.
-...
diff --git a/source/includes/steps-configure-ldap-sasl-activedirectory-authentication.yaml b/source/includes/steps-configure-ldap-sasl-activedirectory-authentication.yaml
index 73111742a95..6dc819a0e27 100644
--- a/source/includes/steps-configure-ldap-sasl-activedirectory-authentication.yaml
+++ b/source/includes/steps-configure-ldap-sasl-activedirectory-authentication.yaml
@@ -44,7 +44,7 @@ pre: |
:setting:`security.ldap.servers`.
You must also enable LDAP authentication by setting
- :setting:`security.authorization` to `enabled` and :setting:`setParameter`
+ :setting:`security.authorization` to ``enabled`` and :setting:`setParameter`
:parameter:`authenticationMechanisms` to ``PLAIN``
.. example::
@@ -308,7 +308,7 @@ pre: |
prompts for the password.
:abbr:`Windows (Microsoft Windows)` MongoDB deployments must use
- :binary:`~bin.mongo.exe` instead of :binary:`~bin.mongo`.
+ :binary:`mongo.exe ` instead of :binary:`~bin.mongo`.
Given the configured :ref:`Active Directory users
`, the user authenticates successfully and
diff --git a/source/includes/steps-control-access-to-mongodb-windows-with-kerberos-authentication.yaml b/source/includes/steps-control-access-to-mongodb-windows-with-kerberos-authentication.yaml
index 5a445e6edfa..db9142fe576 100644
--- a/source/includes/steps-control-access-to-mongodb-windows-with-kerberos-authentication.yaml
+++ b/source/includes/steps-control-access-to-mongodb-windows-with-kerberos-authentication.yaml
@@ -2,12 +2,12 @@ title: Start ``mongod.exe`` without Kerberos.
stepnum: 1
ref: start-mongod-exe-without-kerberos-support
pre: |
- For the initial addition of Kerberos users, start :binary:`~bin.mongod.exe`
- without Kerberos support.
+ For the initial addition of Kerberos users, start
+ :binary:`~bin.mongod.exe` without Kerberos support.
post: |
If a Kerberos user is already in MongoDB and has the
:ref:`privileges required to create a user
- `, you can start
+ `, you can start
:binary:`~bin.mongod.exe` with Kerberos support.
Include additional settings as appropriate to your deployment.
@@ -20,7 +20,7 @@ title: Connect to ``mongod``.
stepnum: 2
ref: connect-to-mongod
pre: |
- Connect via the :binary:`~bin.mongo.exe` shell to the :binary:`~bin.mongod.exe`
+ Connect via the :binary:`~bin.mongo` shell to the :binary:`~bin.mongod.exe`
instance. If :binary:`~bin.mongod.exe` has :option:`--auth ` enabled, ensure
you connect with the :ref:`privileges required to create a user
`.
@@ -91,18 +91,18 @@ title: Connect ``mongo.exe`` shell to ``mongod.exe`` and authenticate.
stepnum: 5
ref: authenticate-a-user-within-mongo-shell
pre: |
- Connect the :binary:`~bin.mongo.exe` shell client as the Kerberos
+ Connect the :binary:`mongo.exe ` shell client as the Kerberos
principal ``application@EXAMPLE.NET``.
action:
- pre: |
You can connect and authenticate from the command line.
- Using :binary:`~bin.cmd.exe`:
+ Using ``cmd.exe``:
language: sh
code: |
mongo.exe --host hostname.example.net --authenticationMechanism=GSSAPI --authenticationDatabase=$external --username reportingapp@EXAMPLE.NET
- pre: |
- Using :binary:`~bin.Windows PowerShell`:
+ Using ``Windows PowerShell``:
language: sh
code: |
mongo.exe --host hostname.example.net --authenticationMechanism=GSSAPI --authenticationDatabase='$external' --username reportingapp@EXAMPLE.NET
@@ -116,10 +116,11 @@ action:
match the Kerberos name, use :option:`--gssapiHostName `
to specify the Kerberos FQDN that it responds to.
- pre: |
- Alternatively, you can first connect :binary:`~bin.mongo.exe` to the
- :binary:`~bin.mongod.exe`, and then from the :binary:`~bin.mongo.exe` shell, use
- the :method:`db.auth()` method to authenticate in the
- ``$external`` database.
+ Alternatively, you can first connect :binary:`mongo.exe
+ ` to the :binary:`~bin.mongod.exe`, and then from the
+ :binary:`mongo.exe ` shell, use the
+ :method:`db.auth()` method to authenticate in the ``$external``
+ database.
language: javascript
code: |
use $external
diff --git a/source/includes/steps-convert-replica-set-add-new-shard.yaml b/source/includes/steps-convert-replica-set-add-new-shard.yaml
index 5e3294aea92..5c7a3d29047 100644
--- a/source/includes/steps-convert-replica-set-add-new-shard.yaml
+++ b/source/includes/steps-convert-replica-set-add-new-shard.yaml
@@ -4,9 +4,11 @@ title:
ref: start-mongod
pre: |
For each member, start a :binary:`~bin.mongod`, specifying the replica
- set name through the :setting:`replSet` option and its role as a
- shard with the :option:`--shardsvr ` option. Specify additional options,
- such as :option:`--bind_ip `, as appropriate.
+ set name through the :option:`--replSet ` option
+ and its role as a shard with the
+ :option:`--shardsvr ` option. Specify additional
+ options, such as :option:`--bind_ip `, as
+ appropriate.
.. include:: /includes/warning-bind-ip-security-considerations.rst
diff --git a/source/includes/steps-enable-authentication-in-replica-set-no-downtime.yaml b/source/includes/steps-enable-authentication-in-replica-set-no-downtime.yaml
index 4297d551116..fa29b40d561 100644
--- a/source/includes/steps-enable-authentication-in-replica-set-no-downtime.yaml
+++ b/source/includes/steps-enable-authentication-in-replica-set-no-downtime.yaml
@@ -165,7 +165,7 @@ action:
- pre: |
If your application uses a MongoDB driver, see the associated
- :ecosystem:`driver ` documentation for instructions on
+ :driver:`driver >` documentation for instructions on
creating an authenticated connection.
post: |
@@ -304,7 +304,7 @@ action:
shut down the old primary :binary:`~bin.mongod`.
From a :binary:`~bin.mongo` shell connected to the old primary, issue the
- :method:`db.shutdownServer()` on the `admin` database.
+ :method:`db.shutdownServer()` on the ``admin`` database.
language: javascript
code: |
@@ -372,8 +372,8 @@ action:
- heading: Shut down the secondary or arbiter members
pre: |
- Connect to a :binary:`~bin.mongo` shell to the secondary or arbiter, and
- issue the :method:`db.shutdownServer()` on the `database`.
+ Connect a :binary:`~bin.mongo` shell to the secondary or arbiter, and
+ issue the :method:`db.shutdownServer()` on the ``admin`` database.
language: javascript
code: |
@@ -461,7 +461,7 @@ action:
shut down the old primary :binary:`~bin.mongod`.
From a :binary:`~bin.mongo` shell connected to the old primary, issue the
- :method:`db.shutdownServer()` on the `admin` database.
+ :method:`db.shutdownServer()` on the ``admin`` database.
language: javascript
code: |
diff --git a/source/includes/steps-enable-authentication-in-shardcluster-nodowntime-uac.yaml b/source/includes/steps-enable-authentication-in-shardcluster-nodowntime-uac.yaml
index 4985842babc..579ac7c9f22 100644
--- a/source/includes/steps-enable-authentication-in-shardcluster-nodowntime-uac.yaml
+++ b/source/includes/steps-enable-authentication-in-shardcluster-nodowntime-uac.yaml
@@ -101,6 +101,6 @@ pre: |
--authenticationDatabase "marketing" --host mongos1.example.net:27017
If your application uses a MongoDB driver, see the associated
- :ecosystem:`driver ` documentation for instructions on creating
+ :driver:`driver >` documentation for instructions on creating
an authenticated connection.
...
diff --git a/source/includes/steps-install-mongodb-enterprise-with-docker.yaml b/source/includes/steps-install-mongodb-enterprise-with-docker.yaml
index dc9c4dc6488..be4c6cdec38 100644
--- a/source/includes/steps-install-mongodb-enterprise-with-docker.yaml
+++ b/source/includes/steps-install-mongodb-enterprise-with-docker.yaml
@@ -11,8 +11,8 @@ pre: |
with the following commands. Set ``MONGODB_VERSION`` to your major
version of choice.
- .. admonition:: Docker Hub Mongo Project
- :class: note
+ .. note:: Docker Hub Mongo Project
+
The Docker Hub mongo project is *not* maintained by MongoDB. Any support
requests should go to `Docker `__.
diff --git a/source/includes/steps-install-mongodb-on-windows-unattended.yaml b/source/includes/steps-install-mongodb-on-windows-unattended.yaml
index 15361029155..4dd901de023 100644
--- a/source/includes/steps-install-mongodb-on-windows-unattended.yaml
+++ b/source/includes/steps-install-mongodb-on-windows-unattended.yaml
@@ -51,25 +51,30 @@ pre: |
- Binaries Included in the Component Set
* - ``ServerNoService``
- - ``mongod.exe``
+ - :binary:`~bin.mongod.exe`
* - ``ServerService``
- - Set up ``mongod.exe`` as a Windows service.
+ - Set up :binary:`~bin.mongod.exe` as a Windows service.
* - ``Router``
- - ``mongos.exe``
+ - :binary:`~bin.mongos.exe`
* - ``Client``
- - ``mongo.exe``
+ - :binary:`mongo.exe `
* - ``MonitoringTools``
- - ``mongostat.exe``, ``mongotop.exe``
+ - :binary:`mongostat.exe `,
+ :binary:`mongotop.exe `
* - ``ImportExportTools``
- - ``mongodump.exe``, ``mongorestore.exe``, ``mongoexport.exe``, ``mongoimport.exe``
+ - :binary:`mongodump.exe