diff --git a/source/administration/configuration.txt b/source/administration/configuration.txt index de45f8b42c4..b85db464e21 100644 --- a/source/administration/configuration.txt +++ b/source/administration/configuration.txt @@ -235,8 +235,8 @@ among all members of the set. Consider the following: replication: replSetName: set0 -Use descriptive names for sets. Once configured, use the -:binary:`~bin.mongo` shell to add hosts to the replica set. +Use descriptive names for sets. Once configured, use +:mongosh:`mongosh ` to add hosts to the replica set. .. seealso:: diff --git a/source/administration/monitoring.txt b/source/administration/monitoring.txt index 6d9189d3ea0..56119a13220 100644 --- a/source/administration/monitoring.txt +++ b/source/administration/monitoring.txt @@ -499,15 +499,15 @@ has a background :term:`balancer` process that distributes data to ensure that chunks are always optimally distributed among the :term:`shards `. Issue the :method:`db.printShardingStatus()` or :method:`sh.status()` -command to the :binary:`~bin.mongos` by way of the :binary:`~bin.mongo` -shell. This returns an overview of the entire cluster including the +command to the :binary:`~bin.mongos` from within :mongosh:`mongosh `. +This returns an overview of the entire cluster including the database name, and a list of the chunks. Stale Locks ~~~~~~~~~~~ To check the lock status of the database, connect to a -:binary:`~bin.mongos` instance using the :binary:`~bin.mongo` shell. Issue the +:binary:`~bin.mongos` instance using :mongosh:`mongosh `. Issue the following command sequence to switch to the ``config`` database and display all outstanding locks on the shard database: diff --git a/source/administration/production-notes.txt b/source/administration/production-notes.txt index 26ae90a53d2..3347566e9a4 100644 --- a/source/administration/production-notes.txt +++ b/source/administration/production-notes.txt @@ -56,7 +56,7 @@ MongoDB requires the following minimum ``x86_64`` microarchitectures: - For AMD ``x86_64``, MongoDB requires *Bulldozer* or later. Starting in MongoDB 5.0, :binary:`~bin.mongod`, :binary:`~bin.mongos`, -and the :binary:`~bin.mongo` shell no longer support ``x86_64`` +and the legacy :binary:`~bin.mongo` shell no longer support ``x86_64`` platforms which do not meet this minimum microarchitecture requirement. .. include:: /includes/fact-platform-x86_64.rst @@ -76,7 +76,7 @@ MongoDB on ``arm64`` requires the *ARMv8.2-A* or later microarchitecture. Starting in MongoDB 5.0, :binary:`~bin.mongod`, :binary:`~bin.mongos`, -and the :binary:`~bin.mongo` shell no longer support ``arm64`` +and the legacy :binary:`~bin.mongo` shell no longer support ``arm64`` platforms which do not meet this minimum microarchitecture requirement. .. include:: /includes/fact-platform-arm64.rst diff --git a/source/appendix/security/appendixA-openssl-ca.txt b/source/appendix/security/appendixA-openssl-ca.txt index eafce6a1208..30e8ea97765 100644 --- a/source/appendix/security/appendixA-openssl-ca.txt +++ b/source/appendix/security/appendixA-openssl-ca.txt @@ -159,7 +159,7 @@ B. Generate the Test CA PEM File cat mongodb-test-ca.crt mongodb-test-ia.crt > test-ca.pem You can use the :red:`test` PEM file when configuring :binary:`~bin.mongod`, -:binary:`~bin.mongos`, or :binary:`~bin.mongo` for TLS/SSL :red:`testing`. +:binary:`~bin.mongos`, or :mongosh:`mongosh ` for TLS/SSL :red:`testing`. You can use the :red:`test` intermediate authority to sign the :red:`test` certificates for both the server(s) and client(s). A single authority diff --git a/source/appendix/security/appendixC-openssl-client.txt b/source/appendix/security/appendixC-openssl-client.txt index ea286e633c1..bbdc157bbca 100644 --- a/source/appendix/security/appendixC-openssl-client.txt +++ b/source/appendix/security/appendixC-openssl-client.txt @@ -132,9 +132,9 @@ B. Generate the Test PEM File for Client cat mongodb-test-client.crt mongodb-test-client.key > test-client.pem - You can use the :red:`test` PEM file to configure the :binary:`~bin.mongo` - shell for TLS/SSL :red:`testing`. For example, to connect to a - :binary:`~bin.mongod` or a :binary:`~bin.mongos`: + You can use the :red:`test` PEM file to configure + :mongosh:`mongosh ` for TLS/SSL :red:`testing`. For example, to + connect to a :binary:`~bin.mongod` or a :binary:`~bin.mongos`: .. example:: @@ -163,7 +163,7 @@ B. Generate the Test PEM File for Client openssl pkcs12 -export -out test-client.pfx -inkey mongodb-test-client.key -in mongodb-test-client.crt -certfile mongodb-test-ia.crt Once added to Keychain Access, instead of specifying the Certificate Key - file, you can use the :option:`--tlsCertificateSelector ` to specify the certificate to use. If the CA file is also in Keychain Access, you can omit ``--tlsCAFile`` as well as in the following example: @@ -174,8 +174,8 @@ B. Generate the Test PEM File for Client mongo --tls --tlsCertificateSelector subject="" - Although still available, :option:`--ssl ` and - :option:`--sslCertificateSelector ` and + :option:`--sslCertificateSelector ` are :ref:`deprecated as of MongoDB 4.2 <4.2-tls>`. diff --git a/source/changeStreams.txt b/source/changeStreams.txt index ad38d33245a..147c6795f7a 100644 --- a/source/changeStreams.txt +++ b/source/changeStreams.txt @@ -69,7 +69,7 @@ You can open change streams against: The examples on this page use the MongoDB drivers to open and work with a change stream cursor for a single collection. See - also the :binary:`~bin.mongo` shell method + also the :mongosh:`mongosh ` method :method:`db.collection.watch()`. * - A database @@ -80,7 +80,7 @@ You can open change streams against: collections. For the MongoDB driver method, refer to your driver - documentation. See also the :binary:`~bin.mongo` shell method + documentation. See also the :mongosh:`mongosh ` method :method:`db.watch()`. @@ -92,7 +92,7 @@ You can open change streams against: databases except for ``admin``, ``local``, and ``config``. For the MongoDB driver method, refer to your driver - documentation. See also the :binary:`~bin.mongo` shell method + documentation. See also the :mongosh:`mongosh ` method :method:`Mongo.watch()`. .. note:: Change Stream Examples diff --git a/source/core/aggregation-pipeline.txt b/source/core/aggregation-pipeline.txt index 18a6de5380d..8e75bf415f7 100644 --- a/source/core/aggregation-pipeline.txt +++ b/source/core/aggregation-pipeline.txt @@ -49,9 +49,8 @@ exception of :pipeline:`$out`, :pipeline:`$merge`, and of all available stages, see :ref:`aggregation-pipeline-operator-reference`. -MongoDB provides the :method:`db.collection.aggregate()` method in the -:binary:`~bin.mongo` shell and the :dbcommand:`aggregate` command to -run the aggregation pipeline. +MongoDB provides the :method:`db.collection.aggregate()` shell method +and the :dbcommand:`aggregate` command to run the aggregation pipeline. For example usage of the aggregation pipeline, consider :doc:`/tutorial/aggregation-with-user-preference-data` and diff --git a/source/core/authentication-mechanisms.txt b/source/core/authentication-mechanisms.txt index 28c9df6d15d..245c0e7cb8c 100644 --- a/source/core/authentication-mechanisms.txt +++ b/source/core/authentication-mechanisms.txt @@ -46,7 +46,7 @@ To specify the authentication mechanism to use, set the :binary:`~bin.mongos`. Clients specify the authentication mechanism in the :method:`db.auth()` method. -For the :binary:`~bin.mongo` shell and the MongoDB tools, you can also specify the +For :mongosh:`mongosh ` and the MongoDB tools, you can also specify the authentication mechanism from the command line. .. toctree:: diff --git a/source/core/capped-collections.txt b/source/core/capped-collections.txt index 7df8ef84bae..5f079b49cc0 100644 --- a/source/core/capped-collections.txt +++ b/source/core/capped-collections.txt @@ -144,12 +144,12 @@ Create a Capped Collection ~~~~~~~~~~~~~~~~~~~~~~~~~~ You must create capped collections explicitly using the -:method:`db.createCollection()` method, which is a helper in the -:binary:`~bin.mongo` shell for the :dbcommand:`create` command. When -creating a capped collection you must specify the maximum size of the -collection in bytes, which MongoDB will pre-allocate for the collection. -The size of the capped collection includes a small amount of space for -internal overhead. +:method:`db.createCollection()` method, which is a +:mongosh:`mongosh ` helper for the :dbcommand:`create` command. +When creating a capped collection you must specify the maximum size of +the collection in bytes, which MongoDB will pre-allocate for the +collection. The size of the capped collection includes a small amount of +space for internal overhead. .. code-block:: javascript diff --git a/source/core/databases-and-collections.txt b/source/core/databases-and-collections.txt index 942a810f715..46a7daffe2a 100644 --- a/source/core/databases-and-collections.txt +++ b/source/core/databases-and-collections.txt @@ -21,7 +21,7 @@ gathered together in :term:`collections `. A Databases --------- In MongoDB, databases hold one or more collections of documents. To -select a database to use, in the :binary:`~bin.mongo` shell, issue the +select a database to use, in :mongosh:`mongosh `, issue the ``use `` statement, as in the following example: .. code-block:: javascript @@ -33,8 +33,8 @@ Create a Database If a database does not exist, MongoDB creates the database when you first store data for that database. As such, you can switch to a -non-existent database and perform the following operation in the -:binary:`~bin.mongo` shell: +non-existent database and perform the following operation in +:mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/core/gridfs.txt b/source/core/gridfs.txt index 740aa22b075..fa1b4d1e64c 100644 --- a/source/core/gridfs.txt +++ b/source/core/gridfs.txt @@ -287,7 +287,7 @@ exists before read and write operations. See the relevant driver documentation for the specific behavior of your GridFS application. If this index does not exist, you can issue the following operation to -create it using the :binary:`~bin.mongo` shell: +create it using :mongosh:`mongosh `: .. code-block:: javascript @@ -312,7 +312,7 @@ read and write operations. See the relevant driver documentation for the specific behavior of your GridFS application. If this index does not exist, you can issue the following operation to -create it using the :binary:`~bin.mongo` shell: +create it using :mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/core/hashed-sharding.txt b/source/core/hashed-sharding.txt index 02c23ad0415..838c8537f99 100644 --- a/source/core/hashed-sharding.txt +++ b/source/core/hashed-sharding.txt @@ -50,7 +50,7 @@ Sharding on a Compound Hashed Index .. include:: /includes/warning-hashed-index-floating-point.rst .. [#hashvalue] - Starting in version 4.0, the :binary:`~bin.mongo` shell provides the + Starting in version 4.0, :mongosh:`mongosh ` provides the method :method:`convertShardKeyToHashed()`. This method uses the same hashing function as the hashed index and can be used to see what the hashed value would be for a key. diff --git a/source/core/index-creation.txt b/source/core/index-creation.txt index 67e8d857342..9787647de6f 100644 --- a/source/core/index-creation.txt +++ b/source/core/index-creation.txt @@ -352,7 +352,7 @@ Monitor In Progress Index Builds -------------------------------- To see the status of an index build operation, you can use the -:method:`db.currentOp()` method in the :binary:`~bin.mongo` shell. To +:method:`db.currentOp()` method in :mongosh:`mongosh `. To filter the current operations for index creation operations, see :ref:`currentOp-index-creation` for an example. diff --git a/source/core/index-hashed.txt b/source/core/index-hashed.txt index 6e8c52ad5f5..b3e976c362b 100644 --- a/source/core/index-hashed.txt +++ b/source/core/index-hashed.txt @@ -39,7 +39,7 @@ an array into a hashed indexed field returns an error. .. include:: /includes/tip-applications-do-not-need-to-compute-hashes.rst .. [#hashvalue] - Starting in version 4.0, the :binary:`~bin.mongo` shell provides the + Starting in version 4.0, :mongosh:`mongosh ` provides the method :method:`convertShardKeyToHashed()`. This method uses the same hashing function as the hashed index and can be used to see what the hashed value would be for a key. @@ -121,7 +121,7 @@ indexed field has the value 2\ :sup:`63`. To list all ``hashed`` indexes for all collections in your deployment, you can use the following -operation in the :binary:`~bin.mongo` shell: +operation in :mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/core/index-hidden.txt b/source/core/index-hidden.txt index e13ec685b01..8e3dd49895f 100644 --- a/source/core/index-hidden.txt +++ b/source/core/index-hidden.txt @@ -134,7 +134,7 @@ Hide an Existing Index - You cannot hide the ``_id`` index. To hide an existing index, you can use the :dbcommand:`collMod` command -or the :binary:`~bin.mongo` shell helper +or :mongosh:`mongosh ` helper :method:`db.collection.hideIndex()`. For example, create an index without hiding: @@ -196,7 +196,7 @@ Unhide an Existing Index ~~~~~~~~~~~~~~~~~~~~~~~~ To unhide a hidden index, you can use the :dbcommand:`collMod` command -or the :binary:`~bin.mongo` shell helper +or :mongosh:`mongosh ` helper :method:`db.collection.unhideIndex()`. You can specify either: - the index key specification document to the diff --git a/source/core/index-sparse.txt b/source/core/index-sparse.txt index afa4d21b062..01ea6ee66e9 100644 --- a/source/core/index-sparse.txt +++ b/source/core/index-sparse.txt @@ -36,8 +36,8 @@ Create a Sparse Index To create a ``sparse`` index, use the :method:`db.collection.createIndex()` method with the ``sparse`` option -set to ``true``. For example, the following operation in the -:binary:`~bin.mongo` shell creates a sparse index on the ``xmpp_id`` field +set to ``true``. For example, the following operation in +:mongosh:`mongosh ` creates a sparse index on the ``xmpp_id`` field of the ``addresses`` collection: .. code-block:: javascript diff --git a/source/core/index-ttl.txt b/source/core/index-ttl.txt index 919d1c15271..c5fcacdd6aa 100644 --- a/source/core/index-ttl.txt +++ b/source/core/index-ttl.txt @@ -37,7 +37,7 @@ option with the desired TTL value in seconds. For example, to create a TTL index on the ``lastModifiedDate`` field of the ``eventlog`` collection, with a TTL value of ``3600`` seconds, use -the following operation in the :binary:`~bin.mongo` shell: +the following operation in :mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/core/index-unique.txt b/source/core/index-unique.txt index 3d8e5c4093e..1461e8a4ae5 100644 --- a/source/core/index-unique.txt +++ b/source/core/index-unique.txt @@ -46,8 +46,8 @@ Unique Index on a Single Field ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For example, to create a unique index on the ``user_id`` field of the -``members`` collection, use the following operation in the -:binary:`~bin.mongo` shell: +``members`` collection, use the following operation in +:mongosh:`mongosh `: .. code-block:: javascript @@ -65,7 +65,7 @@ uniqueness on the *combination* of the index key values. For example, to create a unique index on ``groupNumber``, ``lastname``, and ``firstname`` fields of the ``members`` collection, use the -following operation in the :binary:`~bin.mongo` shell: +following operation in :mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/core/kerberos.txt b/source/core/kerberos.txt index aa1bdc8e0ad..2fe71bb3bff 100644 --- a/source/core/kerberos.txt +++ b/source/core/kerberos.txt @@ -100,7 +100,7 @@ principal name ``mongodb/m1.example.com@EXAMPLE.COM``. To specify a different value for ````, use :setting:`~security.sasl.serviceName` during the start up of :binary:`~bin.mongod` or :binary:`~bin.mongos` (or :binary:`~bin.mongod.exe` or :binary:`~bin.mongos.exe`). -:binary:`~bin.mongo` shell or other clients may also specify a different +:mongosh:`mongosh ` or other clients may also specify a different service principal name using :setting:`~security.sasl.serviceName`. Service principal names must be reachable over the network using the diff --git a/source/core/query-optimization.txt b/source/core/query-optimization.txt index 57689a08ab9..e7f1d8ea1ae 100644 --- a/source/core/query-optimization.txt +++ b/source/core/query-optimization.txt @@ -36,7 +36,7 @@ indexes in MongoDB `. To improve the performance of this query, add an ascending or a descending index to the ``inventory`` collection on the ``type`` - field. [#ensureIndexOrder]_ In the :binary:`~bin.mongo` shell, you can + field. [#ensureIndexOrder]_ In :mongosh:`mongosh `, you can create indexes using the :method:`db.collection.createIndex()` method: diff --git a/source/core/read-isolation-consistency-recency.txt b/source/core/read-isolation-consistency-recency.txt index 2f604d9e12e..483a4cf7267 100644 --- a/source/core/read-isolation-consistency-recency.txt +++ b/source/core/read-isolation-consistency-recency.txt @@ -155,7 +155,7 @@ For causally related operations: .. note:: Operations can be causally consistent across different sessions. - MongoDB drivers and the :binary:`~bin.mongo` shell provide the + MongoDB drivers and :mongosh:`mongosh ` provide the methods to advance the operation time and the cluster time for a client session. So, a client can advance the cluster time and the operation time of one client session to be consistent with the diff --git a/source/core/read-preference-hedge-option.txt b/source/core/read-preference-hedge-option.txt index b9f83dcc5f5..30cd9db3fe7 100644 --- a/source/core/read-preference-hedge-option.txt +++ b/source/core/read-preference-hedge-option.txt @@ -29,7 +29,7 @@ read by default. - When using the drivers, refer to the :driver:`drivers' read preference API `. -- When using the :binary:`~bin.mongo` shell, you can use the helper +- When using :mongosh:`mongosh `, you can use the helper methods :method:`cursor.readPref()` and :method:`Mongo.setReadPref()`. Additional Information @@ -47,5 +47,5 @@ Hedged Reads Diagnostics ~~~~~~~~~~~~~~~~~~~~~~~~ The command :dbcommand:`serverStatus` and its corresponding -:binary:`~bin.mongo` shell method :method:`db.serverStatus()` return +:mongosh:`mongosh ` method :method:`db.serverStatus()` return :serverstatus:`hedgingMetrics`. diff --git a/source/core/read-preference.txt b/source/core/read-preference.txt index b685aa34c9d..96c0248eacf 100644 --- a/source/core/read-preference.txt +++ b/source/core/read-preference.txt @@ -218,7 +218,7 @@ For a given read preference, the MongoDB drivers use the same :ref:`member selection logic `. -When using the :binary:`~bin.mongo` shell, see +When using :mongosh:`mongosh `, see :method:`cursor.readPref()` and :method:`Mongo.setReadPref()`. Read Preference and Transactions diff --git a/source/core/retryable-reads.txt b/source/core/retryable-reads.txt index 3d95f95e4d1..ceb0609f194 100644 --- a/source/core/retryable-reads.txt +++ b/source/core/retryable-reads.txt @@ -38,7 +38,7 @@ enable retryable reads by default. To explicitly disable retryable reads, specify :urioption:`retryReads=false ` in the :ref:`connection string ` for the deployment. -The :binary:`~bin.mongo` shell does not support retryable reads. +:mongosh:`mongosh ` does not support retryable reads. .. _retryable-read-ops: diff --git a/source/core/retryable-writes.txt b/source/core/retryable-writes.txt index f4705a4e849..698052ff52f 100644 --- a/source/core/retryable-writes.txt +++ b/source/core/retryable-writes.txt @@ -73,9 +73,9 @@ Enabling Retryable Writes MongoDB Drivers .. include:: /includes/extracts/4.2-changes-drivers-retryWrites-default.rst -:binary:`~bin.mongo` shell - To enable retryable writes in the :binary:`~bin.mongo` shell, use - the :option:`--retryWrites ` command line option: +:mongosh:`mongosh ` + To enable retryable writes in :mongosh:`mongosh `, use + the :option:`--retryWrites ` command line option: .. code-block:: bash @@ -363,7 +363,7 @@ Diagnostics .. versionadded:: 3.6.3 -The :dbcommand:`serverStatus` command, and its :binary:`~bin.mongo` +The :dbcommand:`serverStatus` command, and its :mongosh:`mongosh ` shell helper :method:`db.serverStatus()` includes statistics on retryable writes in the :serverstatus:`transactions` section. diff --git a/source/core/security-automatic-client-side-encryption.txt b/source/core/security-automatic-client-side-encryption.txt index c820887248c..72fa331bec0 100644 --- a/source/core/security-automatic-client-side-encryption.txt +++ b/source/core/security-automatic-client-side-encryption.txt @@ -17,11 +17,12 @@ Automatic Client-Side Field Level Encryption Overview -------- -Official MongoDB 4.2+ compatible drivers and the MongoDB 4.2 or later -:binary:`~bin.mongo` shell support automatically encrypting fields in -read and write operations. For a complete list of official -4.2+ compatible drivers with support for client-side field level -encryption, see :ref:`field-level-encryption-drivers`. +Official MongoDB 4.2+ compatible drivers, :mongosh:`mongosh `, and +the MongoDB 4.2 or later legacy :binary:`~bin.mongo` shell support +automatically encrypting fields in read and write operations. For a +complete list of official 4.2+ compatible drivers with support for +client-side field level encryption, see +:ref:`field-level-encryption-drivers`. Applications must create a database connection object (e.g. ``MongoClient``) with the automatic encryption configuration settings. @@ -33,11 +34,11 @@ code associated with constructing the read/write operation. See :ref:`field-level-encryption-json-schema` for complete documentation on automatic encryption rules. -The official MongoDB 4.2+ compatible drivers and 4.2 or later -:binary:`~bin.mongo` shell use the Enterprise-only -:ref:`field-level-encryption-mongocryptd` process to parse the automatic -encryption rules and apply the encryption rules when reading or writing -documents: +The official MongoDB 4.2+ compatible drivers, :mongosh:`mongosh `, +and the MongoDB 4.2 or later legacy :binary:`~bin.mongo` shell use the +Enterprise-only :ref:`field-level-encryption-mongocryptd` process to +parse the automatic encryption rules and apply the encryption rules when +reading or writing documents: - For write operations, the driver/shell encrypts field values *prior* to writing to the MongoDB database. @@ -60,7 +61,7 @@ key management. Defer to your preferred :ref:`driver's documentation ` for language-specific instructions on implementing automatic client-side field level encryption. -The MongoDB 4.2 :binary:`~bin.mongo` shell adds an additional option +:mongosh:`mongosh ` adds an additional option to the :method:`Mongo()` method for instantiating a database connection with automatic client-side field level encryption. For a complete example, see @@ -71,7 +72,7 @@ Automatic client-side field level encryption requires access to the :ref:`mongocryptd` for complete documentation on installation. The official MongoDB 4.2+ compatible drivers have additional options for managing the ``mongocryptd`` process. Generally, the 4.2+ compatible -drivers and 4.2 or later :binary:`~bin.mongo` shell can access the +drivers and :mongosh:`mongosh ` can access the ``mongocryptd`` process if it is in the system ``PATH``. Applications must specify the following components when instantiating @@ -88,9 +89,10 @@ encryption: specified CMK *prior* to storing them in the key vault, leaving only metadata unencrypted. - 4.2+ compatible drivers and the 4.2 or later :binary:`~bin.mongo` - shell need access to the KMS to encrypt and decrypt protected fields - *or* to create new data encryption keys. + 4.2+ compatible drivers, :mongosh:`mongosh `, and the MongoDB 4.2 + or later legacy :binary:`~bin.mongo` shell need access to the KMS to + encrypt and decrypt protected fields *or* to create new data + encryption keys. - Per-field automatic encryption rules using :ref:`JSON schema syntax `. diff --git a/source/core/security-client-side-encryption-key-management.txt b/source/core/security-client-side-encryption-key-management.txt index 265c93f2f5e..996815173b2 100644 --- a/source/core/security-client-side-encryption-key-management.txt +++ b/source/core/security-client-side-encryption-key-management.txt @@ -49,7 +49,7 @@ transmits the data encryption key to AWS KMS for encrypting or decrypting using the specified Customer Master Key (CMK). The CMK never leaves the AWS KMS. -The :binary:`~bin.mongo` shell supports two methods for configuring +:mongosh:`mongosh ` supports two methods for configuring access to an AWS KMS: - Use the client-side field level encryption :ref:`command-line options @@ -113,7 +113,7 @@ transmits the data encryption key to Azure Key Vault for encrypting or decrypting using the specified Customer Master Key (CMK). The CMK never leaves the Azure Key Vault. -The :binary:`~bin.mongo` shell supports specifying Azure Key Vault +:mongosh:`mongosh ` supports specifying Azure Key Vault as a KMS using the :method:`Mongo()` constructor using the :ref:`KMS configuration options `. @@ -152,7 +152,7 @@ transmits the data encryption key to Google Cloud KMS for encrypting or decrypting using the specified Customer Master Key (CMK). The CMK never leaves the Google Cloud KMS. -The :binary:`~bin.mongo` shell supports specifying Google Cloud KMS +:mongosh:`mongosh ` supports specifying Google Cloud KMS as a KMS using the :method:`Mongo()` constructor using the :ref:`KMS configuration options `. @@ -182,7 +182,7 @@ Google Cloud KMS, see Locally Managed Key ~~~~~~~~~~~~~~~~~~~ -The :binary:`~bin.mongo` shell supports specifying a locally managed key +:mongosh:`mongosh ` supports specifying a locally managed key as a KMS using the :method:`Mongo()` constructor. The local key *must* be a 96-byte long string. @@ -201,7 +201,7 @@ with client-side field level encryption. Data encryption keys are encrypted using a Customer Master Key (CMK) managed through a supported :ref:`Key Management System (KMS) `. -The :binary:`~bin.mongo` shell provides helper methods for data +:mongosh:`mongosh ` provides helper methods for data encryption key management: .. list-table:: @@ -264,7 +264,7 @@ Data encryption keys have the following structure: } Client-side field level encryption depends on uniqueness of -``keyAltNames`` values. The :binary:`~bin.mongo` shell +``keyAltNames`` values. The :mongosh:`mongosh ` :method:`KeyVault.createKey()` method creates a :ref:`unique index ` on ``keyAltNames`` if one does not exist. Applications can use the :dbcommand:`listIndexes` command against the diff --git a/source/core/security-client-side-encryption.txt b/source/core/security-client-side-encryption.txt index 417c7ef29ee..215435a10af 100644 --- a/source/core/security-client-side-encryption.txt +++ b/source/core/security-client-side-encryption.txt @@ -99,9 +99,10 @@ the official MongoDB 4.2+ compatible drivers: Explicit (manual) encryption of fields Official :ref:`MongoDB 4.2+ compatible drivers - ` and the MongoDB 4.2 or later - :binary:`~bin.mongo` shell support explicitly encrypting or decrypting - fields with a specific data encryption key and encryption algorithm. + `, :mongosh:`mongosh `, and + the MongoDB 4.2 or later legacy :binary:`~bin.mongo` shell support + explicitly encrypting or decrypting fields with a specific data + encryption key and encryption algorithm. Applications must modify any code associated with constructing read and write operations to include encryption/decryption logic via the @@ -116,9 +117,9 @@ Automatic encryption of fields .. include:: /includes/extracts/csfle-enterprise-atlas-only.rst Official :ref:`MongoDB 4.2+ compatible drivers - ` and the MongoDB 4.2 or later - :binary:`~bin.mongo` shell support automatically encrypting fields in - read and write operations. + `, :mongosh:`mongosh `, and + the MongoDB 4.2 or later legacy :binary:`~bin.mongo` shell support + automatically encrypting fields in read and write operations. Applications must create a database connection object (e.g. ``MongoClient``) with the automatic encryption configuration settings. @@ -133,10 +134,10 @@ Automatic encryption of fields For more information, see :doc:`/core/security-automatic-client-side-encryption`. -MongoDB 4.2+ compatible drivers and the 4.2 or later -:binary:`~bin.mongo` shell automatically decrypt :bsontype:`Binary` -subtype 6 objects created using client-side field level encryption. For -more information on automatic decryption, see +MongoDB 4.2+ compatible drivers, :mongosh:`mongosh `, and the MongoDB +4.2 or later legacy :binary:`~bin.mongo` shell automatically decrypt +:bsontype:`Binary` subtype 6 objects created using client-side field +level encryption. For more information on automatic decryption, see :ref:`field-level-encryption-automatic-decryption`. .. important:: @@ -159,11 +160,12 @@ driver and each encryption component: - ``libmongocrypt`` is the `Apache-licensed open-source `__ core cryptography - library used by the official MongoDB 4.2+ compatible drivers and the - MongoDB 4.2 or later :binary:`~bin.mongo` shell for powering - client-side field level encryption. Some drivers may require specific - integration steps to install or link the library. Defer to driver - documentation for more complete information. + library used by the official MongoDB 4.2+ compatible drivers, + :mongosh:`mongosh `, and the MongoDB 4.2 or later legacy + :binary:`~bin.mongo` shell for powering client-side field level + encryption. Some drivers may require specific integration steps to + install or link the library. Defer to driver documentation for more + complete information. - :ref:`mongocryptd` supports :ref:`field-level-encryption-automatic` and is only available with MongoDB Enterprise. ``mongocryptd`` does @@ -257,10 +259,10 @@ Automatic Field Decryption The :bsontype:`BinData ` blob metadata includes the data encryption key ``_id`` and encryption algorithm used to encrypt the -binary data. The 4.2+ compatible drivers and 4.2 or later -:binary:`~bin.mongo` shell use this metadata to attempt automatic -decryption of :bsontype:`BinData ` subtype 6 objects. The -automatic decryption process works as follows: +binary data. The 4.2+ compatible drivers, :mongosh:`mongosh `, and +the MongoDB 4.2 or later legacy :binary:`~bin.mongo` shell use this +metadata to attempt automatic decryption of :bsontype:`BinData ` +subtype 6 objects. The automatic decryption process works as follows: 1. Check the :bsontype:`BinData ` blob metadata for the data encryption key and encryption algorithm used to encrypt the diff --git a/source/core/security-explicit-client-side-encryption.txt b/source/core/security-explicit-client-side-encryption.txt index 7b93d248892..7290d8aba45 100644 --- a/source/core/security-explicit-client-side-encryption.txt +++ b/source/core/security-explicit-client-side-encryption.txt @@ -13,9 +13,10 @@ Explicit (Manual) Client-Side Field Level Encryption Overview -------- -MongoDB 4.2+ compatible drivers and the 4.2 or later -:binary:`~bin.mongo` shell support explicitly encrypting or decrypting -fields with a specific data encryption key and encryption algorithm. +MongoDB 4.2+ compatible drivers, :mongosh:`mongosh `, and the MongoDB +4.2 or later legacy :binary:`~bin.mongo` shell support explicitly +encrypting or decrypting fields with a specific data encryption key and +encryption algorithm. Applications must modify any code associated with constructing read and write operations to include encryption/decryption logic via the driver @@ -23,7 +24,7 @@ encryption library. Applications are responsible for selecting the appropriate data encryption key for encryption/decryption on a per-operation basis. -The 4.2 :binary:`~bin.mongo` shell provides the following methods for +:mongosh:`mongosh ` provides the following methods for performing explicit encryption and decryption: - :method:`getClientEncryption()` @@ -38,7 +39,7 @@ level encryption. Defer to the documentation for your preferred driver for specific instructions on performing client-side field level encryption. -The following operation issued from the :binary:`~bin.mongo` shell +The following operation issued from :mongosh:`mongosh ` explicitly encrypts the ``taxid`` field as part of a write operation. .. code-block:: javascript @@ -55,7 +56,7 @@ explicitly encrypts the ``taxid`` field as part of a write operation. ) }) -The following operation issued from the :binary:`~bin.mongo` shell +The following operation issued from :mongosh:`mongosh ` explicitly encrypts the ``taxid`` field as part of a read operation: .. code-block:: javascript @@ -92,7 +93,7 @@ encryption key management. Defer to your preferred language-specific instructions on implementing explicit client-side field level encryption. -The MongoDB 4.2 or later :binary:`~bin.mongo` shell adds an additional +:mongosh:`mongosh ` adds an additional option to the :method:`Mongo()` method for instantiating a database connection with explicit client-side field level encryption. For a complete example, see @@ -112,9 +113,10 @@ encryption: specified CMK *prior* to storing them in the key vault, leaving only metadata unencrypted. - 4.2+ compatible drivers and the 4.2 or later :binary:`~bin.mongo` - shell need access to the KMS to encrypt and decrypt protected fields - *or* to create new data encryption keys. + 4.2+ compatible drivers, :mongosh:`mongosh `, and the MongoDB 4.2 + or later legacy :binary:`~bin.mongo` shell need access to the KMS to + encrypt and decrypt protected fields *or* to create new data + encryption keys. Server-Side Field Level Encryption Enforcement ---------------------------------------------- diff --git a/source/core/security-ldap-external.txt b/source/core/security-ldap-external.txt index 7c5d4cb87ab..783845f93d3 100644 --- a/source/core/security-ldap-external.txt +++ b/source/core/security-ldap-external.txt @@ -402,12 +402,12 @@ via the Operating System LDAP libraries: Connecting to a MongoDB server using LDAP Authorization ------------------------------------------------------- -When using LDAP for authorization, users connecting via the :binary:`~bin.mongo` -shell must: +When using LDAP for authorization, users connecting via +:mongosh:`mongosh ` must: -- set :option:`--authenticationDatabase ` to ``$external``. +- set :option:`--authenticationDatabase ` to ``$external``. -- set :option:`--authenticationMechanism ` to the appropriate authentication +- set :option:`--authenticationMechanism ` to the appropriate authentication mechanism. If using :ref:`LDAP authentication `, set this to ``PLAIN``. @@ -417,13 +417,13 @@ shell must: If using :ref:`x.509 `, set this to ``MONGODB-X.509``. -- set :option:`--username ` to a username that respects the +- set :option:`--username ` to a username that respects the :setting:`security.ldap.authz.queryTemplate`, or any configured :setting:`security.ldap.userToDNMapping` template. -- set :option:`--password ` to the appropriate password. +- set :option:`--password ` to the appropriate password. -Include the :option:`--host ` and :option:`--port ` of the MongoDB server, +Include the :option:`--host ` and :option:`--port ` of the MongoDB server, along with any other options relevant to your deployment. For example, the following operation authenticates to a MongoDB server running @@ -434,7 +434,7 @@ with LDAP authentication and authorization: mongo --username alice@dba.example.com --password --authenticationDatabase '$external' --authenticationMechanism "PLAIN" --host "mongodb.example.com" --port 27017 If you do not specify the password to the :option:`-password ` command-line option, the :binary:`~bin.mongo` shell +--password>` command-line option, :mongosh:`mongosh ` prompts for the password. .. important:: diff --git a/source/core/security-x.509.txt b/source/core/security-x.509.txt index 9ea5d0eafcb..bd21fa82de2 100644 --- a/source/core/security-x.509.txt +++ b/source/core/security-x.509.txt @@ -65,36 +65,36 @@ To connect and authenticate using x.509 client certificate: - For MongoDB 4.2 or greater, include the following options for the client: - - :option:`--tls ` (or the deprecated :option:`--ssl - ` option) + - :option:`--tls ` (or the deprecated :option:`--ssl + ` option) - - :option:`--tlsCertificateKeyFile ` + - :option:`--tlsCertificateKeyFile ` (or the deprecated :option:`--sslPEMKeyFile - ` option) + ` option) - - :option:`--tlsCertificateKeyFilePassword ` + - :option:`--tlsCertificateKeyFilePassword ` (or the deprecated :option:`--sslPEMKeyPassword - ` option) if the certificate key file is encrypted + ` option) if the certificate key file is encrypted - :option:`--authenticationDatabase '$external' - ` + ` - :option:`--authenticationMechanism MONGODB-X509 - ` + ` - For MongoDB 4.0 and earlier, include the following options for the client: - - :option:`--ssl ` + - :option:`--ssl ` - - :option:`--sslPEMKeyFile ` + - :option:`--sslPEMKeyFile ` - - :option:`--sslPEMKeyPassword ` option if - the :option:`--sslPEMKeyFile ` is encrypted. + - :option:`--sslPEMKeyPassword ` option if + the :option:`--sslPEMKeyFile ` is encrypted. - :option:`--authenticationDatabase '$external' - ` + ` - - :option:`--authenticationMechanism MONGODB-X509 ` + - :option:`--authenticationMechanism MONGODB-X509 ` You can also make the TLS/SSL connection first, and then use :method:`db.auth()` in the ``$external`` database to authenticate. diff --git a/source/core/server-side-javascript.txt b/source/core/server-side-javascript.txt index fe618ecee8b..664bc0d130f 100644 --- a/source/core/server-side-javascript.txt +++ b/source/core/server-side-javascript.txt @@ -20,7 +20,7 @@ Overview MongoDB provides the following commands, methods, and operator that perform server-side execution of JavaScript code: -- :dbcommand:`mapReduce` and the corresponding :binary:`~bin.mongo` shell +- :dbcommand:`mapReduce` and the corresponding :mongosh:`mongosh ` method :method:`db.collection.mapReduce()`. For more information, see :doc:`/core/map-reduce`. @@ -30,7 +30,7 @@ perform server-side execution of JavaScript code: - :group:`$accumulator` and :expression:`$function` aggregation operations that allows users to define custom aggregation expressions. -You can also specify a JavaScript file to the :binary:`~bin.mongo` shell to +You can also specify a JavaScript file to :mongosh:`mongosh ` to run on the server. For more information, see :ref:`running-js-scripts-in-mongo-on-mongod-host` @@ -46,11 +46,11 @@ see :ref:`disable-server-side-js`. Running ``.js`` files via a ``mongo`` shell Instance on the Server ------------------------------------------------------------------ -You can specify a JavaScript (``.js``) file to a :binary:`~bin.mongo` shell -instance to execute the file on the server. This is a good technique -for performing batch administrative work. When you run :binary:`~bin.mongo` -shell on the server, connecting via the localhost interface, the -connection is fast with low latency. +You can specify a JavaScript (``.js``) file to :mongosh:`mongosh ` +to execute the file on the server. This is a good technique +for performing batch administrative work. When you run +:mongosh:`mongosh ` on the server, connecting via the localhost +interface, the connection is fast with low latency. Concurrency ----------- diff --git a/source/core/sharded-cluster-config-servers.txt b/source/core/sharded-cluster-config-servers.txt index 2eb37164bcf..9f66e4cc619 100644 --- a/source/core/sharded-cluster-config-servers.txt +++ b/source/core/sharded-cluster-config-servers.txt @@ -146,8 +146,8 @@ Config servers store metadata in the :doc:`/reference/config-database`. Always back up the ``config`` database before doing any maintenance on the config server. -To access the ``config`` database, issue the following command from the -:binary:`~bin.mongo` shell: +To access the ``config`` database, issue the following command in +:mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/core/sharded-cluster-query-router.txt b/source/core/sharded-cluster-query-router.txt index 49dfabda4a9..afbd0f30240 100644 --- a/source/core/sharded-cluster-query-router.txt +++ b/source/core/sharded-cluster-query-router.txt @@ -198,7 +198,7 @@ Hedged Reads Diagnostics ```````````````````````` The command :dbcommand:`serverStatus` and its corresponding -:binary:`~bin.mongo` shell method :method:`db.serverStatus()` return +:mongosh:`mongosh ` method :method:`db.serverStatus()` return :serverstatus:`hedgingMetrics`. Confirm Connection to ``mongos`` Instances @@ -346,9 +346,9 @@ server>`, with the :option:`--auth ` option in order to enforce R Alternatively, enforcing :doc:`/core/security-internal-authentication` for inter-cluster security also enables user access controls via RBAC. -With RBAC enforced, clients must specify a :option:`--username `, -:option:`--password `, and -:option:`--authenticationDatabase ` when +With RBAC enforced, clients must specify a :option:`--username `, +:option:`--password `, and +:option:`--authenticationDatabase ` when connecting to the :binary:`~bin.mongos` in order to access cluster resources. Each cluster has its own cluster users. These users cannot be used diff --git a/source/core/sharded-cluster-shards.txt b/source/core/sharded-cluster-shards.txt index c4d852e3253..a9ad06fdcf9 100644 --- a/source/core/sharded-cluster-shards.txt +++ b/source/core/sharded-cluster-shards.txt @@ -62,7 +62,7 @@ subsequently may reside on any shard in the cluster. Shard Status ------------ -Use the :method:`sh.status()` method in the :binary:`~bin.mongo` shell to +Use the :method:`sh.status()` method in :mongosh:`mongosh ` to see an overview of the cluster. This reports includes which shard is primary for the database and the :term:`chunk` distribution across the shards. See :method:`sh.status()` method for more details. diff --git a/source/core/transactions-in-applications.txt b/source/core/transactions-in-applications.txt index 37e65fe2c26..cf6a4e27adf 100644 --- a/source/core/transactions-in-applications.txt +++ b/source/core/transactions-in-applications.txt @@ -456,7 +456,7 @@ Additional Information ``mongo`` Shell Example ~~~~~~~~~~~~~~~~~~~~~~~ -The following :binary:`~bin.mongo` shell methods are available for +The following :mongosh:`mongosh ` methods are available for transactions: - :method:`Session.startTransaction()` @@ -467,7 +467,7 @@ transactions: .. note:: - The :binary:`~bin.mongo` shell example omits retry logic + The :mongosh:`mongosh ` example omits retry logic and robust error handling for simplicity's sake. For a more practical example of incorporating transactions in applications, see :ref:`transactions-retry` instead. diff --git a/source/core/transactions.txt b/source/core/transactions.txt index 414123ed782..c1655accc6c 100644 --- a/source/core/transactions.txt +++ b/source/core/transactions.txt @@ -317,7 +317,8 @@ This example highlights the key components of the transactions API. .. seealso:: - For an example in :binary:`~bin.mongo` shell, see :ref:`txn-mongo-shell-example`. + For an example in :mongosh:`mongosh `, see + :ref:`txn-mongo-shell-example`. .. _transactions-atomicity: diff --git a/source/core/zone-sharding.txt b/source/core/zone-sharding.txt index 5b52303042e..3780ebcb22c 100644 --- a/source/core/zone-sharding.txt +++ b/source/core/zone-sharding.txt @@ -94,7 +94,7 @@ range represents the *hashed* range between ``5`` and ``10``: Zone A since the *hashed* value of ``8`` does not fall into the defined range. -The :binary:`~bin.mongo` shell provides the +:mongosh:`mongosh ` provides the :method:`convertShardKeyToHashed()` for computing the post-hash value of the specified parameter. diff --git a/source/faq/sharding.txt b/source/faq/sharding.txt index 7696e3ec94b..3dd90350fd8 100644 --- a/source/faq/sharding.txt +++ b/source/faq/sharding.txt @@ -118,8 +118,8 @@ large number of open connections. If the :binary:`~bin.mongos` is no longer in use, it is safe to restart the process to close existing connections. To return aggregated statistics related to all of the outgoing -connection pools used by the :binary:`~bin.mongos`, connect a -:binary:`~bin.mongo` shell to the :binary:`~bin.mongos` with , and run the +connection pools used by the :binary:`~bin.mongos`, connect +:mongosh:`mongosh ` to the :binary:`~bin.mongos`, and run the :dbcommand:`connPoolStats` command: .. code-block:: bash diff --git a/source/faq/storage.txt b/source/faq/storage.txt index 40602f376d6..44607096aa1 100644 --- a/source/faq/storage.txt +++ b/source/faq/storage.txt @@ -107,9 +107,9 @@ How can I check the size of a collection? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To view the statistics for a collection, including the data size, use -the :method:`db.collection.stats()` method from the :binary:`~bin.mongo` -shell. The following example issues :method:`db.collection.stats()` for -the ``orders`` collection: +the :method:`db.collection.stats()` method from within +:mongosh:`mongosh `. The following example issues +:method:`db.collection.stats()` for the ``orders`` collection: .. code-block:: javascript @@ -172,6 +172,6 @@ size for that index reflects the compressed size. How can I get information on the storage use of a database? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The :method:`db.stats()` method in the :binary:`~bin.mongo` shell returns +The :method:`db.stats()` method in :mongosh:`mongosh ` returns the current state of the "active" database. For the description of the returned fields, see :ref:`dbStats Output `. diff --git a/source/includes/4.4-downgrade-clean-shutdown.rst b/source/includes/4.4-downgrade-clean-shutdown.rst index 38c74a8b77e..830fc06bb72 100644 --- a/source/includes/4.4-downgrade-clean-shutdown.rst +++ b/source/includes/4.4-downgrade-clean-shutdown.rst @@ -1,4 +1,4 @@ -Run the following command from the :binary:`~bin.mongo` shell to +Run the following command in :mongosh:`mongosh ` to perform a clean shutdown, or refer to :ref:`terminate-mongod-processes` for additional ways to safely terminate the :binary:`~bin.mongod` process: diff --git a/source/includes/driver-examples/driver-example-query-intro.rst b/source/includes/driver-examples/driver-example-query-intro.rst index 35d6c086dbf..87ffce231de 100644 --- a/source/includes/driver-examples/driver-example-query-intro.rst +++ b/source/includes/driver-examples/driver-example-query-intro.rst @@ -4,8 +4,8 @@ - id: shell content: | This page provides examples of |query_operations| using the - :method:`db.collection.find()` method in the - :binary:`~bin.mongo` shell. The examples on this page use the + :method:`db.collection.find()` method in + :mongosh:`mongosh `. The examples on this page use the ``inventory`` collection. To populate the ``inventory`` collection, run the following: diff --git a/source/includes/driver-list-database-indexes-tabs.rst b/source/includes/driver-list-database-indexes-tabs.rst index a23ca5bfc01..c58aea2c473 100644 --- a/source/includes/driver-list-database-indexes-tabs.rst +++ b/source/includes/driver-list-database-indexes-tabs.rst @@ -7,7 +7,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To list all the collection indexes in a database, you can use the - following operation in the :binary:`~bin.mongo` shell: + following operation in :mongosh:`mongosh `: .. code-block:: javascript @@ -29,7 +29,7 @@ To list all indexes of a certain type (e.g. :doc:`hashed `, :doc:`text `) for all collections in all database, you can use the following - operation in the :binary:`~bin.mongo` shell: + operation in :mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/includes/extracts-changestream.yaml b/source/includes/extracts-changestream.yaml index d37b80482e6..f97b1a4b5d9 100644 --- a/source/includes/extracts-changestream.yaml +++ b/source/includes/extracts-changestream.yaml @@ -1,11 +1,10 @@ ref: changestream-resume content: | - 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 - errors. + Unlike the MongoDB :driver:`Drivers `, :mongosh:`mongosh ` 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 errors. |watchmethod| uses information stored in the oplog to produce the diff --git a/source/includes/extracts-client-side-field-level-encryption.yaml b/source/includes/extracts-client-side-field-level-encryption.yaml index d015f350dc5..0f33c0b431f 100644 --- a/source/includes/extracts-client-side-field-level-encryption.yaml +++ b/source/includes/extracts-client-side-field-level-encryption.yaml @@ -126,8 +126,9 @@ content: | .. important:: - For AWS KMS support, use the 4.2.2 or later :binary:`~bin.mongo` - shell. The 4.2.0 and 4.2.1 :binary:`~bin.mongo` shell does not - support the AWS KMS service due to an unexpected change in the KMS - response object. See :issue:`SERVER-44721` for more information. + For AWS KMS support, use :mongosh:`mongosh `, or the MongoDB + 4.2.2 or later legacy :binary:`~bin.mongo` shell. The 4.2.0 and + 4.2.1 legacy :binary:`~bin.mongo` shell do not support the AWS KMS + service due to an unexpected change in the KMS response object. + See :issue:`SERVER-44721` for more information. ... diff --git a/source/includes/extracts-concurrency-consistency-recency.yaml b/source/includes/extracts-concurrency-consistency-recency.yaml index e36a924845f..7eff447835e 100644 --- a/source/includes/extracts-concurrency-consistency-recency.yaml +++ b/source/includes/extracts-concurrency-consistency-recency.yaml @@ -132,7 +132,7 @@ content: | :writeconcern:`"majority"` write operations may fail. These include operations that inherently use :writeconcern:`"majority"` write concern, such as the :dbcommand:`replSetStepDown` command, or - various :binary:`~bin.mongo` shell methods that by default use + various :mongosh:`mongosh ` methods that by default use :writeconcern:`"majority"` write concern, such as :doc:`user management methods ` and :doc:`role management methods diff --git a/source/includes/extracts-gle-methods-behavior.yaml b/source/includes/extracts-gle-methods-behavior.yaml index 3066db15d72..720eb8c2efc 100644 --- a/source/includes/extracts-gle-methods-behavior.yaml +++ b/source/includes/extracts-gle-methods-behavior.yaml @@ -19,7 +19,7 @@ inherit: ref: _gle-method-definition file: extracts-gle-methods-behavior-base.yaml post: | - The :method:`db.getLastErrorObj()` is a :binary:`~bin.mongo` shell + The :method:`db.getLastErrorObj()` is a :mongosh:`mongosh ` wrapper around the :dbcommand:`getLastError` command. replacement: gle: ":method:`db.getLastErrorObj()`" diff --git a/source/includes/extracts-macos-prevent-from-launch.yaml b/source/includes/extracts-macos-prevent-from-launch.yaml index 6d0518c441c..67dd3ba35a5 100644 --- a/source/includes/extracts-macos-prevent-from-launch.yaml +++ b/source/includes/extracts-macos-prevent-from-launch.yaml @@ -10,5 +10,5 @@ source: ref: _macos-prevent-launch file: extracts-macos-prevent-launch-base.yaml replacement: - binary_name: "the :binary:`~bin.mongo` shell" + binary_name: ":mongosh:`mongosh `" ... diff --git a/source/includes/extracts-mongo-shell-deprecated-meta-operator.yaml b/source/includes/extracts-mongo-shell-deprecated-meta-operator.yaml index ae43c095fac..0db2c098e31 100644 --- a/source/includes/extracts-mongo-shell-deprecated-meta-operator.yaml +++ b/source/includes/extracts-mongo-shell-deprecated-meta-operator.yaml @@ -4,8 +4,8 @@ content: | .. 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, + Starting in v3.2, the {{op}} operator is deprecated in + :mongosh:`mongosh `. In :mongosh:`mongosh `, use {{alternative}} instead. --- @@ -115,7 +115,7 @@ content: | Deprecated in the ``mongo`` Shell since v3.2 Starting in v3.2, the query "meta" operators are deprecated in - the :binary:`~bin.mongo` shell. In the :binary:`~bin.mongo` shell, use + :mongosh:`mongosh `. In :mongosh:`mongosh `, use the :doc:`cursor methods ` instead. diff --git a/source/includes/extracts-run-from-cmd.yaml b/source/includes/extracts-run-from-cmd.yaml index 4b3bff6cd8c..18966168258 100644 --- a/source/includes/extracts-run-from-cmd.yaml +++ b/source/includes/extracts-run-from-cmd.yaml @@ -1,6 +1,7 @@ ref: _require-cmd-line content: | - Run {{command}} from the system command line, not the :binary:`~bin.mongo` shell. + Run {{command}} from the system command line, not in the + :mongosh:`mongosh `. --- ref: require-cmd-line-mongoldap inherit: diff --git a/source/includes/extracts-sessions.yaml b/source/includes/extracts-sessions.yaml index 0d904908390..cac0e48522f 100644 --- a/source/includes/extracts-sessions.yaml +++ b/source/includes/extracts-sessions.yaml @@ -8,7 +8,7 @@ content: | .. important:: - The :binary:`~bin.mongo` shell and the drivers assign these options + :mongosh:`mongosh ` and the drivers assign these options to the commands in the session. .. list-table:: @@ -110,8 +110,8 @@ content: | ref: sessions-cursor-timeout content: | - Starting in MongoDB 3.6, MongoDB drivers and the :binary:`~bin.mongo` - shell associate all operations with a :doc:`server session + Starting in MongoDB 3.6, MongoDB drivers and :mongosh:`mongosh ` + associate all operations with a :doc:`server session `, with the exception of unacknowledged write operations. For operations not explicitly associated with a session (i.e. using :method:`Mongo.startSession()`), MongoDB drivers diff --git a/source/includes/extracts-ssl-facts.yaml b/source/includes/extracts-ssl-facts.yaml index d6a1e48d7a3..8bf237c88b5 100644 --- a/source/includes/extracts-ssl-facts.yaml +++ b/source/includes/extracts-ssl-facts.yaml @@ -48,7 +48,7 @@ content: | (or their aliases ``--sslCAFile`` or ``ssl.CAFile``) is not specified, the system-wide CA certificate store will be used when connecting to an TLS/SSL-enabled server. In previous versions of - MongoDB, the :binary:`~bin.mongo` shell exited with an error that it + MongoDB, :mongosh:`mongosh ` exited with an error that it could not validate the certificate. .. include:: /includes/extracts/ssl-facts-x509-ca-file.rst @@ -65,10 +65,10 @@ content: | ``--sslAllowInvalidCertificates`` is necessary, only use the option on systems where intrusion is not possible. - If the :binary:`~bin.mongo` shell (and other + If :mongosh:`mongosh ` (and other :ref:`mongodb-tools-support-ssl`) runs with the - ``--sslAllowInvalidCertificates`` option, the - :binary:`~bin.mongo` shell (and other + ``--sslAllowInvalidCertificates`` option, + :mongosh:`mongosh ` (and other :ref:`mongodb-tools-support-ssl`) will not attempt to validate the server certificates. This creates a vulnerability to expired :binary:`~bin.mongod` and :binary:`~bin.mongos` certificates as @@ -81,13 +81,13 @@ content: | ref: ssl-facts-mongo-ssl-hostname-verification content: | - The :binary:`~bin.mongo` shell verifies that the hostname (specified - in :option:`--host ` option or the connection string) + :mongosh:`mongosh ` verifies that the hostname (specified + in :option:`--host ` option or the connection string) matches the ``SAN`` (or, if ``SAN`` is not present, the ``CN``) in the certificate presented by the :binary:`~bin.mongod` or - :binary:`~bin.mongos`. If ``SAN`` is present, :binary:`~bin.mongo` + :binary:`~bin.mongos`. If ``SAN`` is present, :mongosh:`mongosh ` does not match against the ``CN``. If the hostname does not match - the ``SAN`` (or ``CN``), the :binary:`~bin.mongo` shell will fail to + the ``SAN`` (or ``CN``), :mongosh:`mongosh ` will fail to connect. .. include:: /includes/extracts/4.2-changes-SAN-matching.rst diff --git a/source/includes/extracts-tls-facts.yaml b/source/includes/extracts-tls-facts.yaml index 1de40f272e4..f8b44b5875f 100644 --- a/source/includes/extracts-tls-facts.yaml +++ b/source/includes/extracts-tls-facts.yaml @@ -40,7 +40,7 @@ content: | If ``--tlsCAFile`` or ``tls.CAFile`` is not specified, the system-wide CA certificate store will be used when connecting to an TLS-enabled server. In previous versions - of MongoDB, the :binary:`~bin.mongo` shell exited with an error that + of MongoDB, :mongosh:`mongosh ` exited with an error that it could not validate the certificate. .. include:: /includes/extracts/tls-facts-x509-ca-file.rst @@ -56,10 +56,10 @@ content: | ``--tlsAllowInvalidCertificates`` on systems where intrusion is not possible. - If the :binary:`~bin.mongo` shell (and other + If :mongosh:`mongosh ` (and other :ref:`mongodb-tools-support-tls`) runs with the - ``--tlsAllowInvalidCertificates`` option, the - :binary:`~bin.mongo` shell (and other + ``--tlsAllowInvalidCertificates`` option, + :mongosh:`mongosh ` (and other :ref:`mongodb-tools-support-tls`) will not attempt to validate the server certificates. This creates a vulnerability to expired :binary:`~bin.mongod` and :binary:`~bin.mongos` certificates as @@ -73,13 +73,13 @@ ref: tls-facts-mongo-tls-options-configure content: | To connect to a :binary:`~bin.mongod` or :binary:`~bin.mongos` that - uses TLS, you must also specify the ``--host`` option for the - :binary:`~bin.mongo` shell if you haven't specified a connect - string. The :binary:`~bin.mongo` shell verifies that the hostname of + uses TLS, you must also specify the ``--host`` option to + :mongosh:`mongosh ` if you haven't specified a connect + string. :mongosh:`mongosh ` verifies that the hostname of the :binary:`~bin.mongod` or :binary:`~bin.mongos` matches the CN or SAN of ``--tlsCertificateKeyFile`` certificate presented by the :binary:`~bin.mongod` or :binary:`~bin.mongos`. If the hostname does - not match the CN/SAN, :binary:`~bin.mongo` will fail to connect. + not match the CN/SAN, :mongosh:`mongosh ` will fail to connect. .. include:: /includes/extracts/4.2-changes-SAN-matching.rst diff --git a/source/includes/extracts-transactions.yaml b/source/includes/extracts-transactions.yaml index a3dd5e0438d..db25827f8af 100644 --- a/source/includes/extracts-transactions.yaml +++ b/source/includes/extracts-transactions.yaml @@ -367,7 +367,7 @@ content: | method that uses the :pipeline:`$group` with a :group:`$sum` expression to perform a count. The 4.0 drivers have deprecated the ``count()`` API. - Starting in MongoDB 4.0.3, the :binary:`~bin.mongo` shell provides the + Starting in MongoDB 4.0.3, :mongosh:`mongosh ` provides the :method:`db.collection.countDocuments()` helper method that uses the :pipeline:`$group` with a :group:`$sum` expression to perform a count. diff --git a/source/includes/fact-authenticate.rst b/source/includes/fact-authenticate.rst index 36123a1d472..23c4a23bad6 100644 --- a/source/includes/fact-authenticate.rst +++ b/source/includes/fact-authenticate.rst @@ -2,12 +2,12 @@ To authenticate as a user, you must provide a username, password, and the :ref:`authentication database ` associated with that user. -To authenticate using the :binary:`~bin.mongo` shell, either: +To authenticate using :mongosh:`mongosh `, either: -- Use the :binary:`~bin.mongo` command-line authentication options - (:option:`--username `, - :option:`--password `, and - :option:`--authenticationDatabase `) +- Use the :mongosh:`mongosh ` command-line authentication options + (:option:`--username `, + :option:`--password `, and + :option:`--authenticationDatabase `) when connecting to the :binary:`~bin.mongod` or :binary:`~bin.mongos` instance, or diff --git a/source/includes/fact-change-database-context.rst b/source/includes/fact-change-database-context.rst index c61727300b7..18de70da3a8 100644 --- a/source/includes/fact-change-database-context.rst +++ b/source/includes/fact-change-database-context.rst @@ -1,7 +1,7 @@ -Use the ``use `` helper in the interactive -:binary:`~bin.mongo` shell, or the following :method:`db.getSiblingDB()` -in the interactive shell or in :binary:`~bin.mongo` shell scripts to -change the ``db`` object: +Use the ``use `` helper in :mongosh:`mongosh `, or the +following :method:`db.getSiblingDB()` method in an interactive +:mongosh:`mongosh ` session or in :mongosh:`mongosh ` shell +scripts to change the ``db`` object: .. code-block:: javascript diff --git a/source/includes/fact-collation-driver.rst b/source/includes/fact-collation-driver.rst index 8830f72a96e..4eb15751f37 100644 --- a/source/includes/fact-collation-driver.rst +++ b/source/includes/fact-collation-driver.rst @@ -1,7 +1,7 @@ .. note:: The following examples illustrate indexes and collation in - the :mongosh:`mongosh `. + :mongosh:`mongosh `. Refer to your :api:`driver documentation <>` for instructions on creating indexes with collation in your specific diff --git a/source/includes/fact-create-text-index.rst b/source/includes/fact-create-text-index.rst index 09474a76083..f870c3ce3a9 100644 --- a/source/includes/fact-create-text-index.rst +++ b/source/includes/fact-create-text-index.rst @@ -2,7 +2,7 @@ To perform text search queries, you must have a ``text`` index on your collection. A collection can only have **one** text search index, but that index can cover multiple fields. -For example you can run the following in a :binary:`~bin.mongo` shell to +For example you can run the following in :mongosh:`mongosh ` to allow text search over the ``name`` and ``description`` fields: .. code-block:: javascript diff --git a/source/includes/fact-createkey-returns-uuid.rst b/source/includes/fact-createkey-returns-uuid.rst index 7925e7df001..f25bd454bc6 100644 --- a/source/includes/fact-createkey-returns-uuid.rst +++ b/source/includes/fact-createkey-returns-uuid.rst @@ -11,9 +11,8 @@ compatible driver in order to configure `, you must use the ``base64`` representation of the ``UUID`` string. -You can run the following operation in the :binary:`~bin.mongo` -shell to convert a ``UUID`` hexadecimal string to its ``base64`` -representation: +You can run the following operation in :mongosh:`mongosh ` to convert +a ``UUID`` hexadecimal string to its ``base64`` representation: .. code-block:: javascript diff --git a/source/includes/fact-currentop.rst b/source/includes/fact-currentop.rst index 5b0b2a9dcd6..b7546e75d61 100644 --- a/source/includes/fact-currentop.rst +++ b/source/includes/fact-currentop.rst @@ -12,4 +12,4 @@ limit on the overall size of the result set. For this reason, the :pipeline:`$currentOp` aggregation stage is preferred over the :dbcommand:`currentOp` command and its -:binary:`~bin.mongo` shell helper :method:`db.currentOp()`. \ No newline at end of file +:mongosh:`mongosh ` helper :method:`db.currentOp()`. \ No newline at end of file diff --git a/source/includes/fact-default-bind-ip.rst b/source/includes/fact-default-bind-ip.rst index a93edef256a..a9da0ea195a 100644 --- a/source/includes/fact-default-bind-ip.rst +++ b/source/includes/fact-default-bind-ip.rst @@ -14,8 +14,8 @@ and DEB (Debian, Ubuntu, and derivatives) packages bind to localhost by default. When bound only to the localhost, these MongoDB 3.6 binaries can only -accept connections from clients (including the :binary:`~bin.mongo` shell, -other members in your deployment for replica sets and sharded clusters) +accept connections from clients (including :mongosh:`mongosh ` and +other members of your deployment in replica sets and sharded clusters) that are running on the same machine. Remote clients cannot connect to the binaries bound only to localhost. diff --git a/source/includes/fact-execute-javascript-from-shell.rst b/source/includes/fact-execute-javascript-from-shell.rst index 0d80805904b..e65fd2c1908 100644 --- a/source/includes/fact-execute-javascript-from-shell.rst +++ b/source/includes/fact-execute-javascript-from-shell.rst @@ -1,4 +1,4 @@ -You can execute a ``.js`` file from within the :binary:`~bin.mongo` shell, +You can execute a ``.js`` file from within :mongosh:`mongosh `, using the :method:`load()` function, as in the following: .. code-block:: javascript @@ -8,10 +8,10 @@ using the :method:`load()` function, as in the following: This function loads and executes the :file:`myjstest.js` file. The :method:`load()` method accepts relative and absolute paths. -If the current working directory of the :binary:`~bin.mongo` shell +If the current working directory of :mongosh:`mongosh ` is :file:`/data/db`, and the :file:`myjstest.js` resides in the :file:`/data/db/scripts` directory, then the following calls within -the :binary:`~bin.mongo` shell would be equivalent: +:mongosh:`mongosh ` would be equivalent: .. code-block:: javascript @@ -20,5 +20,5 @@ the :binary:`~bin.mongo` shell would be equivalent: .. note:: There is no search path for the :method:`load()` function. If the desired script is not in the current working - directory or the full specified path, :binary:`~bin.mongo` will not be + directory or the full specified path, :mongosh:`mongosh ` will not be able to access the file. diff --git a/source/includes/fact-explain-methods-differences.rst b/source/includes/fact-explain-methods-differences.rst index 669bcedf2f7..d53736cf3a3 100644 --- a/source/includes/fact-explain-methods-differences.rst +++ b/source/includes/fact-explain-methods-differences.rst @@ -9,8 +9,8 @@ following key differences: - 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 - :binary:`~bin.mongo` shell automatically calls ``.finish()`` to return + If run interactively in :mongosh:`mongosh `, + :mongosh:`mongosh ` automatically calls ``.finish()`` to return the results. For scripts, however, you must explicitly call ``.next()``, or ``.finish()``, to return the results. For list of cursor-related methods, see diff --git a/source/includes/fact-group-map-reduce-where-limitations-in-24.rst b/source/includes/fact-group-map-reduce-where-limitations-in-24.rst index c52ed15a288..2a03f6bda61 100644 --- a/source/includes/fact-group-map-reduce-where-limitations-in-24.rst +++ b/source/includes/fact-group-map-reduce-where-limitations-in-24.rst @@ -1,7 +1,7 @@ :dbcommand:`map-reduce operations ` and :query:`$where` operator expressions **cannot** access certain global functions or -properties, such as ``db``, that are available in the -:binary:`~bin.mongo` shell. +properties, such as ``db``, that are available in +:mongosh:`mongosh `. The following JavaScript functions and properties **are available** to :dbcommand:`map-reduce operations ` and :query:`$where` diff --git a/source/includes/fact-group-sales-documents.rst b/source/includes/fact-group-sales-documents.rst index 6f875c25ef9..8a04cad3970 100644 --- a/source/includes/fact-group-sales-documents.rst +++ b/source/includes/fact-group-sales-documents.rst @@ -1,4 +1,4 @@ -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``sales`` with the following documents: .. code-block:: javascript diff --git a/source/includes/fact-mongo-prompt-size.rst b/source/includes/fact-mongo-prompt-size.rst index c3b22931f53..6d4d9aa133a 100644 --- a/source/includes/fact-mongo-prompt-size.rst +++ b/source/includes/fact-mongo-prompt-size.rst @@ -1,3 +1,3 @@ -The :binary:`~bin.mongo` shell prompt has a limit of 4095 codepoints for +:mongosh:`mongosh ` prompt has a limit of 4095 codepoints for each line. If you enter a line with more than 4095 codepoints, the shell will truncate it. diff --git a/source/includes/fact-mongosh-callout.rst b/source/includes/fact-mongosh-callout.rst index 69caf005a14..65b5aede90e 100644 --- a/source/includes/fact-mongosh-callout.rst +++ b/source/includes/fact-mongosh-callout.rst @@ -1,6 +1,6 @@ .. note:: - The following document pertains to the :binary:`~bin.mongo` shell + The following document pertains to :mongosh:`mongosh ` included in the `MongoDB Server Download `__. diff --git a/source/includes/fact-mongosh-shell-method-toc.rst b/source/includes/fact-mongosh-shell-method-toc.rst index a3d73715e3b..4cf86abd736 100644 --- a/source/includes/fact-mongosh-shell-method-toc.rst +++ b/source/includes/fact-mongosh-shell-method-toc.rst @@ -1,13 +1,13 @@ The methods listed on this table of contents page are -:mongosh:`mongosh ` methods. This is *not* the documention for +:mongosh:`mongosh ` methods. This is *not* the documentation for ``Node.js`` or other programming language specific driver methods. -In most cases :mongosh:`mongosh ` methods work the same way as the +In most cases, :mongosh:`mongosh ` methods work the same way as the legacy :binary:`~bin.mongo` shell methods. However, some legacy methods are unavailable in ``mongosh``. -For legacy :binary:`~bin.mongo` shell documention, refer to the -documentation for the corresponding ``MongoDB`` release. +For the legacy :binary:`~bin.mongo` shell documentation, refer to the +documentation for the corresponding MongoDB Server release: - :v4.4:`mongo shell v4.4 ` - :v4.2:`mongo shell v4.2 ` @@ -15,4 +15,3 @@ documentation for the corresponding ``MongoDB`` release. For MongoDB API drivers, refer to the language specific :driver:`MongoDB driver ` documentation. - diff --git a/source/includes/fact-mongosh-shell-method.rst b/source/includes/fact-mongosh-shell-method.rst index ddf0ef3296b..c516e25ceb1 100644 --- a/source/includes/fact-mongosh-shell-method.rst +++ b/source/includes/fact-mongosh-shell-method.rst @@ -1,15 +1,15 @@ .. important:: ``mongosh`` Method This is a :mongosh:`mongosh ` method. This is *not* the - documention for ``Node.js`` or other programming language specific + documentation for ``Node.js`` or other programming language specific driver methods. - In most cases :mongosh:`mongosh ` methods work the same way as + In most cases, :mongosh:`mongosh ` methods work the same way as the legacy :binary:`~bin.mongo` shell methods. However, some legacy methods are unavailable in ``mongosh``. - For legacy :binary:`~bin.mongo` shell documention, refer to the - documentation for the corresponding ``MongoDB`` release. + For the legacy :binary:`~bin.mongo` shell documentation, refer to the + documentation for the corresponding MongoDB Server release: - :v4.4:`mongo shell v4.4 ` - :v4.2:`mongo shell v4.2 ` @@ -17,4 +17,3 @@ For MongoDB API drivers, refer to the language specific :driver:`MongoDB driver ` documentation. - diff --git a/source/includes/fact-networkMessageCompressors.rst b/source/includes/fact-networkMessageCompressors.rst index 4c6e3909913..431c3ea5d34 100644 --- a/source/includes/fact-networkMessageCompressors.rst +++ b/source/includes/fact-networkMessageCompressors.rst @@ -6,14 +6,14 @@ If you specify multiple compressors, then the order in which you list the compressors matter as well as the communication initiator. For -example, if a :binary:`~bin.mongo` shell specifies the following network +example, if :mongosh:`mongosh ` specifies the following network compressors ``zlib,snappy`` and the :binary:`~bin.mongod` specifies -``snappy,zlib``, messages between :binary:`~bin.mongo` shell and +``snappy,zlib``, messages between :mongosh:`mongosh ` and :binary:`~bin.mongod` uses ``zlib``. If the parties do not share at least one common compressor, messages -between the parties are uncompressed. For example, if a -:binary:`~bin.mongo` shell specifies the network compressor +between the parties are uncompressed. For example, if +:mongosh:`mongosh ` specifies the network compressor ``zlib`` and :binary:`~bin.mongod` specifies ``snappy``, messages -between :binary:`~bin.mongo` shell and :binary:`~bin.mongod` are not compressed. - +between :mongosh:`mongosh ` and :binary:`~bin.mongod` are not +compressed. diff --git a/source/includes/fact-type-fidelity-loss-example.rst b/source/includes/fact-type-fidelity-loss-example.rst index ce2b3bf6903..d389f2b4585 100644 --- a/source/includes/fact-type-fidelity-loss-example.rst +++ b/source/includes/fact-type-fidelity-loss-example.rst @@ -1,6 +1,6 @@ -For example, the following insert operation in the :binary:`~bin.mongo` -shell uses the various :doc:`shell helpers ` for the -BSON types :doc:`Date ` and :doc:`64-bit integer +For example, the following insert operation in :mongosh:`mongosh ` +uses the various :doc:`shell helpers ` for the BSON +types :doc:`Date ` and :doc:`64-bit integer `: .. code-block:: javascript diff --git a/source/includes/fact-update-example-docs-intro.rst b/source/includes/fact-update-example-docs-intro.rst index 157159cfc3d..0d02456d7d3 100644 --- a/source/includes/fact-update-example-docs-intro.rst +++ b/source/includes/fact-update-example-docs-intro.rst @@ -1,3 +1,3 @@ -From the :binary:`~bin.mongo` shell, create a ``books`` collection which +In :mongosh:`mongosh `, create a ``books`` collection which contains the following documents. This command first removes all previously existing documents from the ``books`` collection: diff --git a/source/includes/initiate-replica-set.rst b/source/includes/initiate-replica-set.rst index 5969f096cae..6af902793a1 100644 --- a/source/includes/initiate-replica-set.rst +++ b/source/includes/initiate-replica-set.rst @@ -1,4 +1,4 @@ -From the :binary:`~bin.mongo` shell, run the :method:`rs.initiate()` method. +From :mongosh:`mongosh `, run the :method:`rs.initiate()` method. :method:`rs.initiate()` can take an optional :doc:`replica set configuration document `. In the diff --git a/source/includes/list-mongodb-enterprise-packages.rst b/source/includes/list-mongodb-enterprise-packages.rst index f7bbe9b9510..76631844386 100644 --- a/source/includes/list-mongodb-enterprise-packages.rst +++ b/source/includes/list-mongodb-enterprise-packages.rst @@ -38,7 +38,7 @@ repository, and contains the following officially-supported packages: binary * - ``mongodb-mongosh`` - - Contains the :mongosh:`mongosh ` shell. + - Contains the MongoDB Shell (:mongosh:`mongosh `). * - ``{+package-name-enterprise+}-tools`` - A ``metapackage`` that automatically installs the component diff --git a/source/includes/list-mongodb-org-packages.rst b/source/includes/list-mongodb-org-packages.rst index feeb1f79b8c..822dc601ea0 100644 --- a/source/includes/list-mongodb-org-packages.rst +++ b/source/includes/list-mongodb-org-packages.rst @@ -41,7 +41,7 @@ repository, and contains the following officially-supported packages: - Contains the legacy :binary:`~bin.mongo` shell. * - ``mongodb-mongosh`` - - Contains the :mongosh:`mongosh ` shell. + - Contains the MongoDB Shell (:mongosh:`mongosh `). * - ``{+package-name-org+}-tools`` - A ``metapackage`` that automatically installs the component diff --git a/source/includes/note-auth-methods-excluded-from-shell-history.rst b/source/includes/note-auth-methods-excluded-from-shell-history.rst index 4efb140aba8..eeeb4add537 100644 --- a/source/includes/note-auth-methods-excluded-from-shell-history.rst +++ b/source/includes/note-auth-methods-excluded-from-shell-history.rst @@ -1,4 +1,4 @@ .. note:: - The :binary:`~bin.mongo` shell excludes all |operation-name| operations + :mongosh:`mongosh ` excludes all |operation-name| operations from the saved history. diff --git a/source/includes/note-method-does-not-return-json.rst b/source/includes/note-method-does-not-return-json.rst index 137316a26e1..df5bf8eb1b9 100644 --- a/source/includes/note-method-does-not-return-json.rst +++ b/source/includes/note-method-does-not-return-json.rst @@ -1,5 +1,5 @@ .. note:: - The |method| method run in the :binary:`~bin.mongo` shell does + The |method| method run in :mongosh:`mongosh ` does **not** return :term:`JSON`. Use |method| for manual inspection, and |method-alternative| in scripts. diff --git a/source/includes/note-mongo-shell-automatically-iterates-cursor.rst b/source/includes/note-mongo-shell-automatically-iterates-cursor.rst index 15c88bd5a30..935ba5275df 100644 --- a/source/includes/note-mongo-shell-automatically-iterates-cursor.rst +++ b/source/includes/note-mongo-shell-automatically-iterates-cursor.rst @@ -1,3 +1,3 @@ -The :binary:`~bin.mongo` shell iterates the returned cursor automatically +:mongosh:`mongosh ` iterates the returned cursor automatically to print the results. See :doc:`/tutorial/iterate-a-cursor` for -handling cursors manually in the :binary:`~bin.mongo` shell. +handling cursors manually in :mongosh:`mongosh `. diff --git a/source/includes/steps-5.0-downgrade-mongod.yaml b/source/includes/steps-5.0-downgrade-mongod.yaml index b1938983750..b07df55edab 100644 --- a/source/includes/steps-5.0-downgrade-mongod.yaml +++ b/source/includes/steps-5.0-downgrade-mongod.yaml @@ -15,8 +15,8 @@ level: 4 ref: 5.0-downgrade-shutdown-instance content: | - To cleanly shut down the :binary:`~bin.mongod` process, connect a - :binary:`~bin.mongo` shell to the instance and run: + To cleanly shut down the :binary:`~bin.mongod` process, connect + :mongosh:`mongosh ` to the instance and run: .. code-block:: javascript diff --git a/source/includes/steps-5.0-downgrade-replica-set.yaml b/source/includes/steps-5.0-downgrade-replica-set.yaml index 0566741fdd5..88b80dc64f5 100644 --- a/source/includes/steps-5.0-downgrade-replica-set.yaml +++ b/source/includes/steps-5.0-downgrade-replica-set.yaml @@ -23,7 +23,7 @@ content: | #. Wait for the member to recover to ``SECONDARY`` state before downgrading the next secondary. To check the member's state, - use the :method:`rs.status()` method in the :binary:`~bin.mongo` shell. + use the :method:`rs.status()` method in :mongosh:`mongosh `. #. Once the member is in ``SECONDARY`` stage, downgrade the next secondary. @@ -52,14 +52,14 @@ content: | #. Replace the |newversion| binary with the |oldversion| binary and restart. #. Wait for the member to recover to ``ARBITER`` state. To check - the member's state, connect a :binary:`~bin.mongo` shell to the + the member's state, connect :mongosh:`mongosh ` to the member and run :method:`rs.status()` method. --- title: Step down the primary. level: 4 ref: 5.0-step-down-primary pre: | - Use :method:`rs.stepDown()` in the :binary:`~bin.mongo` shell to + Use :method:`rs.stepDown()` in :mongosh:`mongosh ` to step down the :term:`primary` and force the normal :ref:`failover ` procedure. action: diff --git a/source/includes/steps-5.0-downgrade-sharded-cluster.yaml b/source/includes/steps-5.0-downgrade-sharded-cluster.yaml index d4dbd0480bc..3cc3fbdebc7 100644 --- a/source/includes/steps-5.0-downgrade-sharded-cluster.yaml +++ b/source/includes/steps-5.0-downgrade-sharded-cluster.yaml @@ -13,7 +13,7 @@ title: Disable the Balancer. level: 4 ref: disable-balancer content: | - Connect a :binary:`~bin.mongo` shell to a :binary:`~bin.mongos` instance in + Connect :mongosh:`mongosh ` to a :binary:`~bin.mongos` instance in the sharded cluster, and run :method:`sh.stopBalancer()` to disable the balancer: @@ -63,7 +63,7 @@ content: | #. Wait for the member to recover to ``SECONDARY`` state before downgrading the next secondary member. To check - the member's state, connect a :binary:`~bin.mongo` shell to the shard + the member's state, connect :mongosh:`mongosh ` to the shard and run :method:`rs.status()` method. Repeat to downgrade for each secondary member. @@ -86,13 +86,13 @@ content: | #. Replace the |newversion| binary with the |oldversion| binary and restart. #. Wait for the member to recover to ``ARBITER`` state. To check - the member's state, connect a :binary:`~bin.mongo` shell to the + the member's state, connect :mongosh:`mongosh ` to the member and run :method:`rs.status()` method. #. Downgrade the shard's primary. - 1. Step down the replica set primary. Connect a - :binary:`~bin.mongo` shell to the primary and use + 1. Step down the replica set primary. Connect + :mongosh:`mongosh ` to the primary and use :method:`rs.stepDown()` to step down the primary and force an election of a new primary: @@ -109,7 +109,7 @@ content: | When the status shows that the primary has stepped down and another member has assumed ``PRIMARY`` state, proceed. - #. Run the following command from the :binary:`~bin.mongo` shell to + #. Run the following command from :mongosh:`mongosh ` to perform a clean shutdown of the stepped-down primary, or refer to :ref:`terminate-mongod-processes` for additional ways to safely terminate the :binary:`~bin.mongod` process: @@ -139,14 +139,14 @@ content: |- #. Wait for the member to recover to ``SECONDARY`` state before downgrading the next secondary member. To check - the member's state, connect a :binary:`~bin.mongo` shell to the shard + the member's state, connect :mongosh:`mongosh ` to the shard and run :method:`rs.status()` method. Repeat to downgrade for each secondary member. #. Step down the config server primary. - 1. Connect a :binary:`~bin.mongo` shell to the primary and use + 1. Connect :mongosh:`mongosh ` to the primary and use :method:`rs.stepDown()` to step down the primary and force an election of a new primary: @@ -163,7 +163,7 @@ content: |- When the status shows that the primary has stepped down and another member has assumed ``PRIMARY`` state, proceed. - #. Run the following command from the :binary:`~bin.mongo` shell to + #. Run the following command from :mongosh:`mongosh ` to perform a clean shutdown of the stepped-down primary, or refer to :ref:`terminate-mongod-processes` for additional ways to safely terminate the :binary:`~bin.mongod` process: @@ -183,14 +183,14 @@ ref: reenable-balancer content: | Once the downgrade of sharded cluster components is complete, connect - a :binary:`~bin.mongo` shell to a :binary:`~bin.mongos` and + :mongosh:`mongosh ` to a :binary:`~bin.mongos` and :ref:`re-enable the balancer `. .. code-block:: javascript sh.startBalancer() - The :binary:`~bin.mongo` shell method :method:`sh.startBalancer()` + The :mongosh:`mongosh ` method :method:`sh.startBalancer()` also enables auto-splitting for the sharded cluster. ... diff --git a/source/includes/steps-5.0-upgrade-replica-set.yaml b/source/includes/steps-5.0-upgrade-replica-set.yaml index a839e3d56ba..1b2d7ce6e09 100644 --- a/source/includes/steps-5.0-upgrade-replica-set.yaml +++ b/source/includes/steps-5.0-upgrade-replica-set.yaml @@ -16,7 +16,7 @@ title: Step down the replica set primary. level: 5 ref: 5.0-upgrade-rs-step-down-primary content: | - Connect a :binary:`~bin.mongo` shell to the primary and use + Connect :mongosh:`mongosh ` to the primary and use :method:`rs.stepDown()` to step down the primary and force an election of a new primary. --- diff --git a/source/includes/steps-5.0-upgrade-sharded-cluster.yaml b/source/includes/steps-5.0-upgrade-sharded-cluster.yaml index cdd7b4fba71..b3572e167be 100644 --- a/source/includes/steps-5.0-upgrade-sharded-cluster.yaml +++ b/source/includes/steps-5.0-upgrade-sharded-cluster.yaml @@ -3,7 +3,7 @@ level: 4 ref: 5.0-upgrade-disable-balancer content: | - Connect a :binary:`~bin.mongo` shell to a :binary:`~bin.mongos` instance in + Connect :mongosh:`mongosh ` to a :binary:`~bin.mongos` instance in the sharded cluster, and run :method:`sh.stopBalancer()` to disable the balancer: @@ -71,13 +71,13 @@ content: |- #. Wait for the member to recover to ``SECONDARY`` state before upgrading the next secondary member. To check the member's state, - issue :method:`rs.status()` in the :binary:`~bin.mongo` shell. + issue :method:`rs.status()` in :mongosh:`mongosh `. Repeat for each secondary member. #. Step down the replica set primary. - a. Connect a :binary:`~bin.mongo` shell to the primary and use + a. Connect :mongosh:`mongosh ` to the primary and use :method:`rs.stepDown()` to step down the primary and force an election of a new primary: @@ -172,14 +172,14 @@ content: |- #. Wait for the member to recover to ``SECONDARY`` state before upgrading the next secondary member. To check the member's - state, you can issue :method:`rs.status()` in the - :binary:`~bin.mongo` shell. + state, you can issue :method:`rs.status()` in + :mongosh:`mongosh `. Repeat for each secondary member. #. Step down the replica set primary. - Connect a :binary:`~bin.mongo` shell to the primary and use + Connect :mongosh:`mongosh ` to the primary and use :method:`rs.stepDown()` to step down the primary and force an election of a new primary: @@ -249,7 +249,7 @@ level: 4 ref: 5.0-upgrade-reenable-balancer content: |- - Using a |newversion| :binary:`~bin.mongo` shell, connect to a + Using :mongosh:`mongosh `, connect to a :binary:`~bin.mongos` in the cluster and run :method:`sh.startBalancer()` to re-enable the balancer: diff --git a/source/includes/steps-adjust-replica-set-member-priority.yaml b/source/includes/steps-adjust-replica-set-member-priority.yaml index de20ede59c6..6d30ab0aa6c 100644 --- a/source/includes/steps-adjust-replica-set-member-priority.yaml +++ b/source/includes/steps-adjust-replica-set-member-priority.yaml @@ -2,7 +2,7 @@ title: Copy the replica set configuration to a variable. stepnum: 1 ref: copy-configuration-object pre: | - In the :binary:`~bin.mongo` shell, use :method:`rs.conf()` to retrieve + In :mongosh:`mongosh `, use :method:`rs.conf()` to retrieve the replica set configuration and assign it to a variable. For example: action: diff --git a/source/includes/steps-authenticate-as-client.yaml b/source/includes/steps-authenticate-as-client.yaml index 575ead92943..98fa3ea1b72 100644 --- a/source/includes/steps-authenticate-as-client.yaml +++ b/source/includes/steps-authenticate-as-client.yaml @@ -3,9 +3,9 @@ stepnum: 1 ref: authenticate action: pre: | - When using :binary:`~bin.mongo` to connect to a :binary:`~bin.mongod` or + When using :mongosh:`mongosh ` to connect to a :binary:`~bin.mongod` or :binary:`~bin.mongos`, enter your ``username``, ``password``, and - :option:`authenticationDatabase `. For + :option:`authenticationDatabase `. For example: language: javascript code: | diff --git a/source/includes/steps-authenticate-through-ldap.yaml b/source/includes/steps-authenticate-through-ldap.yaml index 98f317912de..a6587426893 100644 --- a/source/includes/steps-authenticate-through-ldap.yaml +++ b/source/includes/steps-authenticate-through-ldap.yaml @@ -2,7 +2,7 @@ title: Authenticate the user in the ``mongo`` shell. stepnum: 1 ref: authenticate pre: | - To perform the authentication in the :binary:`~bin.mongo` shell, use the + To perform the authentication in :mongosh:`mongosh `, use the :method:`db.auth()` method in the ``$external`` database. action: pre: | diff --git a/source/includes/steps-backup-sharded-cluster-with-snapshots.yaml b/source/includes/steps-backup-sharded-cluster-with-snapshots.yaml index 7026a94b9ec..f85a7402ce5 100644 --- a/source/includes/steps-backup-sharded-cluster-with-snapshots.yaml +++ b/source/includes/steps-backup-sharded-cluster-with-snapshots.yaml @@ -3,8 +3,8 @@ stepnum: 1 ref: disable-balancer pre: | - Connect a :binary:`~bin.mongo` shell to a cluster - :binary:`~bin.mongos` instance. Use the :method:`sh.stopBalancer()` + Connect :mongosh:`mongosh ` to a cluster + :binary:`~bin.mongos` instance. Use the :method:`sh.stopBalancer()` method to stop the balancer. If a balancing round is in progress, the operation waits for balancing to complete before stopping the balancer. @@ -47,7 +47,7 @@ action: pre: | For each shard replica set in the sharded cluster, confirm that the member has replicated data up to some control point. To - verify, first connect a :binary:`~bin.mongo` shell to the shard + verify, first connect :mongosh:`mongosh ` to the shard primary and perform a write operation with :writeconcern:`"majority"` write concern on a control collection: @@ -71,7 +71,7 @@ action: { "_id" : "BackupControlDocument", "counter" : 1 } - pre: | Query the shard secondary member for the returned control - document. Connect a :binary:`~bin.mongo` shell to the shard + document. Connect :mongosh:`mongosh ` to the shard secondary to lock and use :method:`db.collection.find()` to query for the control document: language: javascript @@ -98,8 +98,8 @@ action: - heading: Lock config server replica set secondary. pre: | If locking a secondary of the CSRS, confirm that the member has - replicated data up to some control point. To verify, first connect a - :binary:`~bin.mongo` shell to the CSRS primary and perform a write + replicated data up to some control point. To verify, first connect + :mongosh:`mongosh ` to the CSRS primary and perform a write operation with :writeconcern:`"majority"` write concern on a control collection: language: javascript @@ -122,7 +122,7 @@ action: { "_id" : "BackupControlDocument", "counter" : 1 } - pre: | Query the CSRS secondary member for the returned control - document. Connect a :binary:`~bin.mongo` shell to the CSRS secondary + document. Connect :mongosh:`mongosh ` to the CSRS secondary to lock and use :method:`db.collection.find()` to query for the control document: language: javascript @@ -180,7 +180,7 @@ pre: | unlock them. To unlock the replica set members, use :method:`db.fsyncUnlock()` - method in the :binary:`~bin.mongo` shell. + method in :mongosh:`mongosh `. action: language: javascript code: | @@ -190,7 +190,7 @@ title: Enable the balancer. stepnum: 6 ref: enable-balancer pre: | - To re-enable to balancer, connect the :binary:`~bin.mongo` shell to a + To re-enable to balancer, connect :mongosh:`mongosh ` to a :binary:`~bin.mongos` instance and run :method:`sh.startBalancer()`. action: diff --git a/source/includes/steps-backup-sharded-clusters-dumps.yaml b/source/includes/steps-backup-sharded-clusters-dumps.yaml index e3704deb409..1bb43e3c2af 100644 --- a/source/includes/steps-backup-sharded-clusters-dumps.yaml +++ b/source/includes/steps-backup-sharded-clusters-dumps.yaml @@ -3,7 +3,7 @@ stepnum: 1 ref: disable-balancer pre: | To disable the :ref:`balancer `, - connect the :binary:`~bin.mongo` shell to a :binary:`~bin.mongos` instance and run + connect :mongosh:`mongosh ` to a :binary:`~bin.mongos` instance and run :method:`sh.stopBalancer()` in the ``config`` database. action: language: javascript @@ -33,8 +33,8 @@ pre: | action: - heading: Lock shard replica set secondary. pre: | - For each shard replica set in the sharded cluster, connect a - :binary:`~bin.mongo` shell to the secondary member's + For each shard replica set in the sharded cluster, connect + :mongosh:`mongosh ` to the secondary member's :binary:`~bin.mongod` instance and run :method:`db.fsyncLock()`. language: javascript code: | @@ -43,8 +43,8 @@ action: - heading: Lock config server replica set secondary. pre: | If locking a secondary of the CSRS, confirm that the member has - replicated data up to some control point. To verify, first connect a - :binary:`~bin.mongo` shell to the CSRS primary and perform a write + replicated data up to some control point. To verify, first connect + :mongosh:`mongosh ` to the CSRS primary and perform a write operation with :writeconcern:`"majority"` write concern on a control collection: language: javascript @@ -67,7 +67,7 @@ action: { "_id" : "BackupControlDocument", "counter" : 1 } - pre: | Query the CSRS secondary member for the returned control - document. Connect a :binary:`~bin.mongo` shell to the CSRS secondary + document. Connect :mongosh:`mongosh ` to the CSRS secondary to lock and use :method:`db.collection.find()` to query for the control document: language: javascript @@ -112,7 +112,7 @@ action: If your deployment uses CSRS config servers, unlock the config server node before proceeding to the next step. To unlock the CSRS member, use :method:`db.fsyncUnlock()` method in - the :binary:`~bin.mongo` shell. + :mongosh:`mongosh `. language: javascript code: | db.fsyncUnlock() @@ -135,7 +135,7 @@ stepnum: 5 ref: restart-replica-set-members pre: | To unlock the replica set members, use :method:`db.fsyncUnlock()` - method in the :binary:`~bin.mongo` shell. + method in :mongosh:`mongosh `. action: language: javascript code: | @@ -147,7 +147,7 @@ title: Re-enable the balancer process. stepnum: 6 ref: reenable-balancer-process pre: | - To re-enable to balancer, connect the :binary:`~bin.mongo` shell to a + To re-enable to balancer, connect :mongosh:`mongosh ` to a :binary:`~bin.mongos` instance and run :method:`sh.setBalancerState()`. action: diff --git a/source/includes/steps-backup-without-journaling.yaml b/source/includes/steps-backup-without-journaling.yaml index f189fe2c8d9..d58fecf773f 100644 --- a/source/includes/steps-backup-without-journaling.yaml +++ b/source/includes/steps-backup-without-journaling.yaml @@ -3,7 +3,7 @@ stepnum: 1 ref: flush pre: | To flush writes to disk and to "lock" the database, issue the - :method:`db.fsyncLock()` method in the :binary:`~bin.mongo` shell: + :method:`db.fsyncLock()` method in :mongosh:`mongosh `: action: language: javascript code: | @@ -18,7 +18,7 @@ stepnum: 3 ref: unlock pre: | To unlock the database after the snapshot has completed, use the - following command in the :binary:`~bin.mongo` shell: + following command in :mongosh:`mongosh `: action: language: javascript code: | 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 8441d398af6..5f7a81346f5 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 @@ -11,8 +11,8 @@ action: code: | mongo --port 27017 -u myUserAdmin -p --authenticationDatabase 'admin' post: | - If you do not specify the password to the :option:`-p ` - command-line option, the :binary:`~bin.mongo` shell prompts for the + If you do not specify the password to the :option:`-p ` + command-line option, :mongosh:`mongosh ` prompts for the password. --- stepnum: 2 diff --git a/source/includes/steps-change-own-password-and-custom-data.yaml b/source/includes/steps-change-own-password-and-custom-data.yaml index 9aae38cdc9e..c7e7f08842c 100644 --- a/source/includes/steps-change-own-password-and-custom-data.yaml +++ b/source/includes/steps-change-own-password-and-custom-data.yaml @@ -14,8 +14,8 @@ action: mongo --port 27017 -u user123 --authenticationDatabase 'test' -p post: | - If you do not specify the password to the :option:`-p ` - command-line option, the :binary:`~bin.mongo` shell prompts for the + If you do not specify the password to the :option:`-p ` + command-line option, :mongosh:`mongosh ` prompts for the password. To check that you have the privileges specified in the diff --git a/source/includes/steps-change-replica-set-wiredtiger.yaml b/source/includes/steps-change-replica-set-wiredtiger.yaml index 5ccf070dfe9..c6d6fe907e6 100644 --- a/source/includes/steps-change-replica-set-wiredtiger.yaml +++ b/source/includes/steps-change-replica-set-wiredtiger.yaml @@ -1,7 +1,7 @@ title: "Shut down the secondary member." ref: change-wt-repl-sync-shutdown-secondary pre: | - In the :binary:`~bin.mongo` shell, shut down the secondary. + In :mongosh:`mongosh `, shut down the secondary. action: language: sh code: | diff --git a/source/includes/steps-clear-jumbo-flag-command.yaml b/source/includes/steps-clear-jumbo-flag-command.yaml index 6b45a6bbe7e..90eb6dd93c7 100644 --- a/source/includes/steps-clear-jumbo-flag-command.yaml +++ b/source/includes/steps-clear-jumbo-flag-command.yaml @@ -2,7 +2,7 @@ title: Connect to ``mongos``. ref: connect-mongos level: 4 content: | - Connect a :binary:`~bin.mongo` shell to a :binary:`~bin.mongos`. + Connect :mongosh:`mongosh ` to a :binary:`~bin.mongos`. --- title: Find the ``jumbo`` Chunk. ref: find-jumbo diff --git a/source/includes/steps-clear-jumbo-flag-preferred.yaml b/source/includes/steps-clear-jumbo-flag-preferred.yaml index a46f2b60ad6..0224b68a3ea 100644 --- a/source/includes/steps-clear-jumbo-flag-preferred.yaml +++ b/source/includes/steps-clear-jumbo-flag-preferred.yaml @@ -1,7 +1,7 @@ title: Connect to ``mongos``. ref: connect-mongos content: | - Connect a :binary:`~bin.mongo` shell to a :binary:`~bin.mongos`. + Connect :mongosh:`mongosh ` to a :binary:`~bin.mongos`. level: 4 --- title: Find the ``jumbo`` Chunk. diff --git a/source/includes/steps-clear-jumbo-flag-refine-key.yaml b/source/includes/steps-clear-jumbo-flag-refine-key.yaml index b429002e65b..717415eb663 100644 --- a/source/includes/steps-clear-jumbo-flag-refine-key.yaml +++ b/source/includes/steps-clear-jumbo-flag-refine-key.yaml @@ -2,7 +2,7 @@ title: Connect to ``mongos``. ref: connect-mongos level: 4 content: | - Connect a :binary:`~bin.mongo` shell to a :binary:`~bin.mongos`. + Connect :mongosh:`mongosh ` to a :binary:`~bin.mongos`. --- title: Find the ``jumbo`` Chunk. ref: find-jumbo diff --git a/source/includes/steps-clear-jumbo-flag.yaml b/source/includes/steps-clear-jumbo-flag.yaml index 404c33a21eb..8c97847f9b8 100644 --- a/source/includes/steps-clear-jumbo-flag.yaml +++ b/source/includes/steps-clear-jumbo-flag.yaml @@ -20,7 +20,7 @@ title: Connect to ``mongos``. ref: connect-mongos level: 4 content: | - Connect a :binary:`~bin.mongo` shell to a :binary:`~bin.mongos`. + Connect :mongosh:`mongosh ` to a :binary:`~bin.mongos`. --- title: Find the ``jumbo`` Chunk. ref: find-jumbo @@ -86,7 +86,7 @@ content: | You must flush the cache on the **config server primary** for the namespace. This notifies the balancer of the jumbo flag clearance. - Connect a :binary:`~bin.mongo` shell to the **config server + Connect :mongosh:`mongosh ` to the **config server primary** and run :dbcommand:`flushRouterConfig` for the collection: diff --git a/source/includes/steps-configure-ldap-mongodb.yaml b/source/includes/steps-configure-ldap-mongodb.yaml index 0686ba5c5fb..f71f46b18f3 100644 --- a/source/includes/steps-configure-ldap-mongodb.yaml +++ b/source/includes/steps-configure-ldap-mongodb.yaml @@ -92,7 +92,7 @@ content: | content: | To authenticate when connecting with the ``mongo`` shell, - run :binary:`~bin.mongo` with the following command-line + run :mongosh:`mongosh ` with the following command-line options, substituting ```` and ````, and enter your password when prompted: diff --git a/source/includes/steps-configure-ldap-sasl-activedirectory-authentication.yaml b/source/includes/steps-configure-ldap-sasl-activedirectory-authentication.yaml index 08df8997d89..636b69107c4 100644 --- a/source/includes/steps-configure-ldap-sasl-activedirectory-authentication.yaml +++ b/source/includes/steps-configure-ldap-sasl-activedirectory-authentication.yaml @@ -280,15 +280,15 @@ pre: | database with :authrole:`userAdmin`, :authrole:`userAdminAnyDatabase`, or a custom role with equivalent privileges. - Use the :binary:`~bin.mongo` shell to authenticate to the MongoDB + Use :mongosh:`mongosh ` to authenticate to the MongoDB server, set the following options: - - :option:`--host ` with the hostname of the MongoDB server - - :option:`--port ` with the port of the MongoDB server - - :option:`--username ` to the user's username - - :option:`--password ` to the user's password - - :option:`--authenticationMechanism ` to ``'PLAIN'`` - - :option:`--authenticationDatabase ` to ``'$external'`` + - :option:`--host ` with the hostname of the MongoDB server + - :option:`--port ` with the port of the MongoDB server + - :option:`--username ` to the user's username + - :option:`--password ` to the user's password + - :option:`--authenticationMechanism ` to ``'PLAIN'`` + - :option:`--authenticationDatabase ` to ``'$external'`` .. example:: @@ -303,12 +303,12 @@ pre: | mongo --username sam@DBA.EXAMPLE.COM --password --authenticationMechanism 'PLAIN' --authenticationDatabase '$external' --host --port - If you do not specify the password to the :option:`-p ` command-line option, the :binary:`~bin.mongo` shell + If you do not specify the password to the :option:`-p ` command-line option, :mongosh:`mongosh ` prompts for the password. :abbr:`Windows (Microsoft Windows)` MongoDB deployments must use - :binary:`mongo.exe ` instead of :binary:`~bin.mongo`. + :binary:`mongo.exe ` instead of :mongosh:`mongosh `. Given the configured :ref:`Active Directory users `, the user authenticates successfully and @@ -317,7 +317,7 @@ pre: | .. note:: If you want to authenticate as an existing non-``$external`` user, set - :option:`--authenticationMechanism ` to SCRAM authentication mechanism (e.g. ``SCRAM-SHA-1`` or ``SCRAM-SHA-256`` as appropriate). This requires + :option:`--authenticationMechanism ` to SCRAM authentication mechanism (e.g. ``SCRAM-SHA-1`` or ``SCRAM-SHA-256`` as appropriate). This requires that the MongoDB server's :setting:`setParameter` :parameter:`authenticationMechanisms` includes ``SCRAM-SHA-1`` and/or ``SCRAM-SHA-256``. diff --git a/source/includes/steps-configure-secondary-only-rs-member.yaml b/source/includes/steps-configure-secondary-only-rs-member.yaml index 010c8be0b80..a4edd578ef2 100644 --- a/source/includes/steps-configure-secondary-only-rs-member.yaml +++ b/source/includes/steps-configure-secondary-only-rs-member.yaml @@ -6,7 +6,7 @@ pre: | configuration document ` that contains the current configuration for a replica set. - In a :binary:`~bin.mongo` shell connected to a primary, run the + In :mongosh:`mongosh `, when connected to a primary, run the :method:`rs.conf()` method and assign the result to a variable: action: language: javascript 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 db9142fe576..b7886739c45 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 @@ -20,7 +20,7 @@ title: Connect to ``mongod``. stepnum: 2 ref: connect-to-mongod pre: | - Connect via the :binary:`~bin.mongo` shell to the :binary:`~bin.mongod.exe` + Connect :mongosh:`mongosh ` 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 `. @@ -113,7 +113,7 @@ action: option, rather than an IP address or unqualified hostname. If you are connecting to a system whose hostname does not - match the Kerberos name, use :option:`--gssapiHostName ` + match the Kerberos name, use :option:`--gssapiHostName ` to specify the Kerberos FQDN that it responds to. - pre: | Alternatively, you can first connect :binary:`mongo.exe diff --git a/source/includes/steps-control-access-to-mongodb-with-kerberos-authentication.yaml b/source/includes/steps-control-access-to-mongodb-with-kerberos-authentication.yaml index 4f27695a86b..d41d4f99b82 100644 --- a/source/includes/steps-control-access-to-mongodb-with-kerberos-authentication.yaml +++ b/source/includes/steps-control-access-to-mongodb-with-kerberos-authentication.yaml @@ -21,7 +21,7 @@ title: Connect to ``mongod``. stepnum: 2 ref: connect-to-mongod pre: | - Connect via the :binary:`~bin.mongo` shell to the :binary:`~bin.mongod` + Connect :mongosh:`mongosh ` to the :binary:`~bin.mongod` instance. If :binary:`~bin.mongod` has :option:`--auth ` enabled, ensure you connect with the :ref:`privileges required to create a user `. @@ -104,7 +104,7 @@ title: Connect ``mongo`` shell to ``mongod`` and authenticate. stepnum: 5 ref: invoke-an-authenticated-mongo-shell pre: | - Connect the :binary:`~bin.mongo` shell client as the Kerberos principal + Connect :mongosh:`mongosh ` client as the Kerberos principal ``application/reporting@EXAMPLE.NET``. Before connecting, you must have used Kerberos's ``kinit`` program to get credentials for ``application/reporting@EXAMPLE.NET``. @@ -120,11 +120,11 @@ action: option, rather than an IP address or unqualified hostname. If you are connecting to a system whose hostname does not - match the Kerberos name, use :option:`--gssapiHostName ` + 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` to the - :binary:`~bin.mongod`, and then from the :binary:`~bin.mongo` shell, use + Alternatively, you can first connect :mongosh:`mongosh ` to the + :binary:`~bin.mongod`, and then from :mongosh:`mongosh `, use the :method:`db.auth()` method to authenticate in the ``$external`` database. language: javascript 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 5c7a3d29047..36c7b95b702 100644 --- a/source/includes/steps-convert-replica-set-add-new-shard.yaml +++ b/source/includes/steps-convert-replica-set-add-new-shard.yaml @@ -24,11 +24,11 @@ post: | Repeat this step for the other two members of the ``rs1`` replica set. --- title: - text: Connect a :binary:`~bin.mongo` shell to a replica set member. + text: Connect :mongosh:`mongosh ` to a replica set member. character: "`" ref: open-shell pre: | - Connect a :binary:`~bin.mongo` shell to *one* member of the replica set + Connect :mongosh:`mongosh ` to *one* member of the replica set (e.g. ``mongodb3.example.net``) action: copyable: true @@ -40,7 +40,7 @@ title: "Initiate the replica set." level: 4 ref: initiate-rs pre: | - From the :binary:`~bin.mongo` shell, run :method:`rs.initiate()` to + From :mongosh:`mongosh `, run :method:`rs.initiate()` to initiate a replica set that consists of the current member. .. important:: @@ -76,8 +76,9 @@ title: character: "`" ref: add-mongos-shard pre: | - In a :binary:`~bin.mongo` shell connected to the :binary:`~bin.mongos`, add - the shard to the cluster with the :method:`sh.addShard()` method: + In :mongosh:`mongosh `, when connected to the + :binary:`~bin.mongos`, add the shard to the cluster with the + :method:`sh.addShard()` method: action: copyable: true language: javascript diff --git a/source/includes/steps-convert-replica-set-shard-aware.yaml b/source/includes/steps-convert-replica-set-shard-aware.yaml index b05c469e035..fe84664237e 100644 --- a/source/includes/steps-convert-replica-set-shard-aware.yaml +++ b/source/includes/steps-convert-replica-set-shard-aware.yaml @@ -2,7 +2,7 @@ title: Determine the primary and secondary members. level: 4 ref: determine-rs-role content: | - Connect a :binary:`~bin.mongo` shell to one of the members and run + Connect :mongosh:`mongosh ` to one of the members and run :method:`rs.status()` to determine the primary and secondary members. --- title: Restart secondary members with the ``--shardsvr`` option. @@ -29,7 +29,7 @@ title: Step down the primary. level: 4 ref: step-down-primary pre: | - Connect a :binary:`~bin.mongo` shell to the primary and stepdown the primary. + Connect :mongosh:`mongosh ` to the primary and stepdown the primary. action: language: javascript code: | diff --git a/source/includes/steps-convert-replica-set-shard-deploy-infrastructure.yaml b/source/includes/steps-convert-replica-set-shard-deploy-infrastructure.yaml index 78542cff30a..f3e5d68b1d5 100644 --- a/source/includes/steps-convert-replica-set-shard-deploy-infrastructure.yaml +++ b/source/includes/steps-convert-replica-set-shard-deploy-infrastructure.yaml @@ -20,7 +20,7 @@ action: specific to your deployment, see :doc:`/reference/program/mongod` or :doc:`/reference/configuration-options`. - pre: | - Connect a :binary:`~bin.mongo` shell to one of the config servers and + Connect :mongosh:`mongosh ` to one of the config servers and run :method:`rs.initiate()` to initiate the replica set. .. important:: diff --git a/source/includes/steps-create-admin-then-enable-authentication.yaml b/source/includes/steps-create-admin-then-enable-authentication.yaml index 2738411123b..eb26ddb2b12 100644 --- a/source/includes/steps-create-admin-then-enable-authentication.yaml +++ b/source/includes/steps-create-admin-then-enable-authentication.yaml @@ -20,16 +20,16 @@ level: 4 ref: connect pre: | - For example, open a new terminal and connect a :binary:`~bin.mongo` - shell to the instance: + For example, open a new terminal and connect :mongosh:`mongosh ` + to the instance: action: language: sh code: | mongo --port 27017 post: | - Specify additional command line options as appropriate to connect the - :binary:`~bin.mongo` shell to your deployment, such as ``--host``. + Specify additional command line options as appropriate to connect + :mongosh:`mongosh ` to your deployment, such as ``--host``. --- stepnum: 3 title: Create the user administrator. @@ -37,7 +37,7 @@ level: 4 ref: create-user-admin pre: | - From the :binary:`~bin.mongo` shell, add a user with the + From :mongosh:`mongosh `, add a user with the :authrole:`userAdminAnyDatabase` role in the ``admin`` database. Include additional roles as needed for this user. For example, the following creates the user ``myUserAdmin`` in the ``admin`` database with the @@ -77,13 +77,13 @@ ref: restart-with-auth content: | a. Shut down the :binary:`~bin.mongod` instance. For example, from - the :binary:`~bin.mongo` shell, issue the following command: + :mongosh:`mongosh `, issue the following command: .. code-block:: javascript db.adminCommand( { shutdown: 1 } ) - #. Exit the :binary:`~bin.mongo` shell. + #. Exit :mongosh:`mongosh `. #. Start the :binary:`~bin.mongod` with access control enabled. @@ -112,7 +112,7 @@ level: 4 stepnum: 5 ref: auth-as-admin content: | - Using the :binary:`~bin.mongo` shell, you can: + Using :mongosh:`mongosh `, you can: - Connect with authentication by passing in user credentials, or @@ -125,9 +125,9 @@ content: | - id: cmdline name: Authenticate during Connection content: | - Start a :binary:`~bin.mongo` shell with the :option:`-u - \ `, :option:`-p `, and the - :option:`--authenticationDatabase \ ` with the :option:`-u + \ `, :option:`-p `, and the + :option:`--authenticationDatabase \ ` command line options: .. code-block:: bash @@ -140,7 +140,7 @@ content: | name: Authenticate after Connection content: | - Connect the :binary:`~bin.mongo` shell to the + Connect :mongosh:`mongosh ` to the :binary:`~bin.mongod`: .. code-block:: bash @@ -148,7 +148,7 @@ content: | mongo --port 27017 - In the :binary:`~bin.mongo` shell, switch to the + In :mongosh:`mongosh `, switch to the authentication database (in this case, ``admin``), and use :method:`db.auth(\, \) ` method to authenticate: @@ -208,20 +208,20 @@ post: | databases; i.e. the user's authentication database does not limit the user's privileges. - After creating the additional users, disconnect the - :binary:`~bin.mongo` shell. + After creating the additional users, disconnect + :mongosh:`mongosh `. --- title: Connect to the instance and authenticate as ``myTester``. level: 4 ref: auth-as-mytester content: | - After disconnecting the :binary:`~bin.mongo` shell as - ``myUserAdmin``, reconnect as ``myTester``. You can: + After disconnecting :mongosh:`mongosh ` as + ``myUserAdmin``, reconnect as ``myTester``. You can: - Connect with authentication by passing in user credentials, or - - Connect first withouth authentication, and then issue the + - Connect first without authentication, and then issue the :method:`db.auth()` method to authenticate. .. tabs:: @@ -230,9 +230,9 @@ content: | - id: cmdline2 name: Authenticate during Connection content: | - Start a :binary:`~bin.mongo` shell with the :option:`-u - \ `, :option:`-p `, and the - :option:`--authenticationDatabase \ ` with the :option:`-u + \ `, :option:`-p `, and the + :option:`--authenticationDatabase \ ` command line options: .. code-block:: bash @@ -245,14 +245,14 @@ content: | name: Authenticate after Connection content: | - Connect the :binary:`~bin.mongo` shell to the + Connect :mongosh:`mongosh ` to the :binary:`~bin.mongod`: .. code-block:: bash mongo --port 27017 - In the :binary:`~bin.mongo` shell, switch to the + In :mongosh:`mongosh `, switch to the authentication database (in this case, ``test``), and use :method:`db.auth(\, \) ` method to authenticate: diff --git a/source/includes/steps-csfle-shell-aws-create-key.yaml b/source/includes/steps-csfle-shell-aws-create-key.yaml index bed2d4f436d..e0aa3c05820 100644 --- a/source/includes/steps-csfle-shell-aws-create-key.yaml +++ b/source/includes/steps-csfle-shell-aws-create-key.yaml @@ -10,8 +10,8 @@ content: | *Read* permissions for the KMS service. To mitigate the risk of these credentials leaking into logs, the - following procedure passes the values into the :binary:`~bin.mongo` - shell using environment variables. + following procedure passes the values into :mongosh:`mongosh ` + using environment variables. First, ensure that you have configured the following environment variables according to your platform's documentation: @@ -19,9 +19,9 @@ content: | - ``AWS_ACCESS_KEY_ID`` - ``AWS_SECRET_ACCESS_KEY`` - Next, create a :binary:`~bin.mongo` shell session using the - :option:`--eval `, :option:`--shell `, - and :option:`--nodb ` options: + Next, create :mongosh:`mongosh ` session using the + :option:`--eval `, :option:`--shell `, + and :option:`--nodb ` options: .. code-block:: bash @@ -31,10 +31,10 @@ content: | " \ --shell --nodb - This example opens the :binary:`~bin.mongo` shell without a + This example opens :mongosh:`mongosh ` without a connection to a MongoDB database. The ``--eval`` option sets the - ``AWS_ACCESS_KEY_ID`` and ``AWS_SECRET_ACCESS_KEY`` variables in the - :binary:`~bin.mongo` shell to the value of the corresponding + ``AWS_ACCESS_KEY_ID`` and ``AWS_SECRET_ACCESS_KEY`` variables in + :mongosh:`mongosh ` to the value of the corresponding environment variables. The specified variables are also supported by the `AWS CLI `__. @@ -45,7 +45,7 @@ ref: create-encryption-configuration level: 4 content: | - In the :binary:`~bin.mongo` shell, create a new + In :mongosh:`mongosh `, create a new :ref:`ClientSideFieldLevelEncryptionOptions` variable for storing the client-side field level encryption configuration document: @@ -67,7 +67,7 @@ ref: connect-with-encryption level: 4 content: | - In the :binary:`~bin.mongo` shell, use the :method:`Mongo()` + In :mongosh:`mongosh `, use the :method:`Mongo()` constructor to establish a database connection to the target cluster. Specify the :ref:`ClientSideFieldLevelEncryptionOptions` document as the second parameter to the :method:`Mongo()` constructor to diff --git a/source/includes/steps-csfle-shell-azure-create-key.yaml b/source/includes/steps-csfle-shell-azure-create-key.yaml index bb5d19330de..f5d67ea7bd6 100644 --- a/source/includes/steps-csfle-shell-azure-create-key.yaml +++ b/source/includes/steps-csfle-shell-azure-create-key.yaml @@ -8,8 +8,8 @@ content: | requires a valid Tenant ID, Client ID, and Client Secret. To mitigate the risk of these credentials leaking into logs, the - following procedure passes the values into the :binary:`~bin.mongo` - shell using environment variables. + following procedure passes the values into :mongosh:`mongosh ` + using environment variables. First, ensure that you have configured the following environment variables according to your platform's documentation: @@ -18,9 +18,9 @@ content: | - ``AZURE_CLIENT_ID`` - ``AZURE_CLIENT_SECRET`` - Next, create a :binary:`~bin.mongo` shell session using the - :option:`--eval `, :option:`--shell `, - and :option:`--nodb ` options: + Next, create a :mongosh:`mongosh ` session using the + :option:`--eval `, :option:`--shell `, + and :option:`--nodb ` options: .. code-block:: bash @@ -31,10 +31,10 @@ content: | " \ --shell --nodb - This example opens the :binary:`~bin.mongo` shell without a + This example opens :mongosh:`mongosh ` without a connection to a MongoDB database. The ``--eval`` option sets the ``AZURE_TENANT_ID``, and ``AZURE_CLIENT_ID``, and - ``AZURE_CLIENT_SECRET`` variables in the :binary:`~bin.mongo` shell to + ``AZURE_CLIENT_SECRET`` variables in :mongosh:`mongosh ` to the value of the corresponding environment variables. --- @@ -43,7 +43,7 @@ ref: create-encryption-configuration level: 4 content: | - In the :binary:`~bin.mongo` shell, create a new + In :mongosh:`mongosh `, create a new :ref:`ClientSideFieldLevelEncryptionOptions` variable for storing the client-side field level encryption configuration document: @@ -66,7 +66,7 @@ ref: connect-with-encryption level: 4 content: | - In the :binary:`~bin.mongo` shell, use the :method:`Mongo()` + In :mongosh:`mongosh `, use the :method:`Mongo()` constructor to establish a database connection to the target cluster. Specify the :ref:`ClientSideFieldLevelEncryptionOptions` document as the second parameter to the :method:`Mongo()` constructor to diff --git a/source/includes/steps-csfle-shell-gcp-create-key.yaml b/source/includes/steps-csfle-shell-gcp-create-key.yaml index ff865a9d3b0..d9c7f395ff6 100644 --- a/source/includes/steps-csfle-shell-gcp-create-key.yaml +++ b/source/includes/steps-csfle-shell-gcp-create-key.yaml @@ -8,8 +8,8 @@ content: | requires your GCP Email and its associated Private Key. To mitigate the risk of these credentials leaking into logs, the - following procedure passes the values into the :binary:`~bin.mongo` - shell using environment variables. + following procedure passes the values into :mongosh:`mongosh ` + using environment variables. First, ensure that you have configured the following environment variables according to your platform's documentation: @@ -17,9 +17,9 @@ content: | - ``GCP_EMAIL`` - ``GCP_PRIVATEKEY`` - Next, create a :binary:`~bin.mongo` shell session using the - :option:`--eval `, :option:`--shell `, - and :option:`--nodb ` options: + Next, create a :mongosh:`mongosh ` session using the + :option:`--eval `, :option:`--shell `, + and :option:`--nodb ` options: .. code-block:: bash @@ -29,10 +29,10 @@ content: | " \ --shell --nodb - This example opens the :binary:`~bin.mongo` shell without a + This example opens :mongosh:`mongosh ` without a connection to a MongoDB database. The ``--eval`` option sets the - ``GCP_EMAIL`` and ``GCP_PRIVATEKEY`` variables in the - :binary:`~bin.mongo` shell to the value of the corresponding + ``GCP_EMAIL`` and ``GCP_PRIVATEKEY`` variables in + :mongosh:`mongosh ` to the value of the corresponding environment variables. --- @@ -41,7 +41,7 @@ ref: create-encryption-configuration level: 4 content: | - In the :binary:`~bin.mongo` shell, create a new + In :mongosh:`mongosh `, create a new :ref:`ClientSideFieldLevelEncryptionOptions` variable for storing the client-side field level encryption configuration document: @@ -63,7 +63,7 @@ ref: connect-with-encryption level: 4 content: | - In the :binary:`~bin.mongo` shell, use the :method:`Mongo()` + In :mongosh:`mongosh `, use the :method:`Mongo()` constructor to establish a database connection to the target cluster. Specify the :ref:`ClientSideFieldLevelEncryptionOptions` document as the second parameter to the :method:`Mongo()` constructor to diff --git a/source/includes/steps-csfle-shell-local-create-key.yaml b/source/includes/steps-csfle-shell-local-create-key.yaml index f9f46c95a8b..6cf533a8a62 100644 --- a/source/includes/steps-csfle-shell-local-create-key.yaml +++ b/source/includes/steps-csfle-shell-local-create-key.yaml @@ -9,8 +9,8 @@ content: | breaks. To mitigate the risk of these credentials leaking into logs, the - following procedure passes the values into the :binary:`~bin.mongo` - shell using environment variables. + following procedure passes the values into :mongosh:`mongosh ` + using environment variables. The following operation generates a key that meets the stated requirements and adds it to the user's ``~/.profile``. If the key @@ -37,19 +37,19 @@ ref: launch-mongo-shell level: 4 content: | - Create a :binary:`~bin.mongo` shell session using the :option:`--eval - `, :option:`--shell `, and - :option:`--nodb ` options: + Create a :mongosh:`mongosh ` session using the :option:`--eval + `, :option:`--shell `, and + :option:`--nodb ` options: .. code-block:: bash mongo --eval "var LOCAL_KEY = '$DEV_LOCAL_KEY' " \ --shell --nodb - The example automatically opens a :binary:`~bin.mongo` shell + The example automatically opens :mongosh:`mongosh ` without a connection to a MongoDB database. The ``--eval`` - option sets the ``LOCAL_KEY`` variable in the :binary:`~bin.mongo` - shell to the value of the corresponding environment variable. + option sets the ``LOCAL_KEY`` variable in :mongosh:`mongosh ` + to the value of the corresponding environment variable. --- title: "Create the Encryption Configuration." @@ -57,7 +57,7 @@ ref: create-encryption-configuration level: 4 content: | - In the :binary:`~bin.mongo` shell, create a new + In :mongosh:`mongosh `, create a new :ref:`ClientSideFieldLevelEncryptionOptions` variable for storing the client-side field level encryption configuration document: @@ -78,7 +78,7 @@ ref: connect-with-encryption level: 4 content: | - In the :binary:`~bin.mongo` shell, use the :method:`Mongo()` + In :mongosh:`mongosh `, use the :method:`Mongo()` constructor to establish a database connection to the target cluster. Specify the :ref:`ClientSideFieldLevelEncryptionOptions` document as the second parameter to the :method:`Mongo()` constructor to diff --git a/source/includes/steps-deploy-geographically-distributed-replica-set-5member.yaml b/source/includes/steps-deploy-geographically-distributed-replica-set-5member.yaml index e2d3f666638..474b8a06d4f 100644 --- a/source/includes/steps-deploy-geographically-distributed-replica-set-5member.yaml +++ b/source/includes/steps-deploy-geographically-distributed-replica-set-5member.yaml @@ -90,7 +90,7 @@ level: 4 ref: initiate-rs pre: | - From the :binary:`~bin.mongo` shell, run :method:`rs.initiate()` on + From :mongosh:`mongosh `, run :method:`rs.initiate()` on replica set member 0. .. important:: diff --git a/source/includes/steps-deploy-replica-set-with-auth.yaml b/source/includes/steps-deploy-replica-set-with-auth.yaml index 6d873276b4e..8b2fb9ae29a 100644 --- a/source/includes/steps-deploy-replica-set-with-auth.yaml +++ b/source/includes/steps-deploy-replica-set-with-auth.yaml @@ -87,10 +87,10 @@ title: Connect to a member of the replica set over the localhost interface. level: 4 ref: deploy-repset-connect-to-member pre: | - Connect a :binary:`~bin.mongo` shell to one of the + Connect :mongosh:`mongosh ` to one of the {{program}} instances over the :ref:`localhost - interface`. You must run the :binary:`~bin.mongo` - shell on the same physical machine as the {{program}} instance. + interface`. You must run :mongosh:`mongosh ` + on the same physical machine as the {{program}} instance. The :ref:`localhost interface` is only available since no users have been created for the deployment. The @@ -196,7 +196,7 @@ pre: | Authenticate to the ``admin`` database. action: - pre: | - In the :binary:`~bin.mongo` shell, use :method:`db.auth()` to + In :mongosh:`mongosh `, use :method:`db.auth()` to authenticate. For example, the following authenticate as the user administrator ``fred``: @@ -208,15 +208,16 @@ action: code: | db.getSiblingDB("admin").auth("fred", passwordPrompt()) // or cleartext password - pre: | - Alternatively, connect a new :binary:`~bin.mongo` shell to the primary - replica set member using the ``-u ``, ``-p ``, and - the ``--authenticationDatabase`` parameters. + Alternatively, connect a new :mongosh:`mongosh ` instance to + the primary replica set member using the ``-u ``, + ``-p ``, and the ``--authenticationDatabase`` + parameters. language: sh code: | mongo -u "fred" -p --authenticationDatabase "admin" post: | - If you do not specify the password to the :option:`-p ` - command-line option, the :binary:`~bin.mongo` shell prompts for the + If you do not specify the password to the :option:`-p ` + command-line option, :mongosh:`mongosh ` prompts for the password. --- stepnum: 8 diff --git a/source/includes/steps-deploy-replica-set.yaml b/source/includes/steps-deploy-replica-set.yaml index 4db80bc1ab1..5e6231e7de7 100644 --- a/source/includes/steps-deploy-replica-set.yaml +++ b/source/includes/steps-deploy-replica-set.yaml @@ -77,15 +77,15 @@ content: | document. --- -title: "Connect a :binary:`~bin.mongo` shell to one of the ``mongod`` instances." +title: "Connect :mongosh:`mongosh ` to one of the ``mongod`` instances." level: 4 ref: open-shell pre: | From the same machine where one of the :binary:`~bin.mongod` is running - (in this tutorial, ``mongodb0.example.net``), start the :binary:`~bin.mongo` - shell. To connect to the :binary:`~bin.mongod` listening to localhost on - the default port of ``27017``, simply issue: + (in this tutorial, ``mongodb0.example.net``), start + :mongosh:`mongosh `. To connect to the :binary:`~bin.mongod` + listening to localhost on the default port of ``27017``, simply issue: action: language: sh code: | @@ -93,14 +93,14 @@ action: post: | Depending on your path, you may need to specify the path to the - :binary:`~bin.mongo` binary. + :mongosh:`mongosh ` binary. --- title: "Initiate the replica set." level: 4 ref: initiate-rs pre: | - From the :binary:`~bin.mongo` shell, run :method:`rs.initiate()` on + From :mongosh:`mongosh `, run :method:`rs.initiate()` on replica set member 0. .. important:: diff --git a/source/includes/steps-deploy-sharded-cluster-config-server-noauth.yaml b/source/includes/steps-deploy-sharded-cluster-config-server-noauth.yaml index d6cb64c214a..c7269ee19fb 100644 --- a/source/includes/steps-deploy-sharded-cluster-config-server-noauth.yaml +++ b/source/includes/steps-deploy-sharded-cluster-config-server-noauth.yaml @@ -71,7 +71,7 @@ level: 4 title: Connect to one of the config servers. ref: csrs-connect pre: | - Connect a :binary:`~bin.mongo` shell to one of the config server + Connect :mongosh:`mongosh ` to one of the config server members. action: copyable: true @@ -85,7 +85,7 @@ level: 4 ref: csrs-initiate pre: | - From the :binary:`~bin.mongo` shell, run the :method:`rs.initiate()` method. + From :mongosh:`mongosh `, run the :method:`rs.initiate()` method. :method:`rs.initiate()` can take an optional :doc:`replica set configuration document `. In the diff --git a/source/includes/steps-deploy-sharded-cluster-connect.yaml b/source/includes/steps-deploy-sharded-cluster-connect.yaml index 5a578f7d0ab..0b6b0617e87 100644 --- a/source/includes/steps-deploy-sharded-cluster-connect.yaml +++ b/source/includes/steps-deploy-sharded-cluster-connect.yaml @@ -122,16 +122,17 @@ action: post: | Enter the password when prompted. - pre: | - Alternatively, connect a new :binary:`~bin.mongo` shell to the target - replica set member using the ``-u ``, ``-p ``, and - the ``--authenticationDatabase "admin"`` parameters. You must use - the :ref:`localhost-exception` to connect to the :binary:`~bin.mongos`. + Alternatively, connect a new :mongosh:`mongosh ` session to the + target replica set member using the ``-u ``, + ``-p ``, and the ``--authenticationDatabase "admin"`` + parameters. You must use the :ref:`localhost-exception` to connect + to the :binary:`~bin.mongos`. language: sh code: | mongo -u "fred" -p --authenticationDatabase "admin" post: | - If you do not specify the password to the :option:`-p ` - command-line option, the :binary:`~bin.mongo` shell prompts for the + If you do not specify the password to the :option:`-p ` + command-line option, :mongosh:`mongosh ` prompts for the password. --- title: Create Administrative User for Cluster Management diff --git a/source/includes/steps-deploy-sharded-cluster-shard-replica-noauth.yaml b/source/includes/steps-deploy-sharded-cluster-shard-replica-noauth.yaml index 5cad2f647ce..79d78d2d2ea 100644 --- a/source/includes/steps-deploy-sharded-cluster-shard-replica-noauth.yaml +++ b/source/includes/steps-deploy-sharded-cluster-shard-replica-noauth.yaml @@ -65,7 +65,7 @@ title: Connect to one member of the shard replica set. level: 4 ref: deploy-repset-connect pre: | - Connect a :binary:`~bin.mongo` shell to one of the replica set members. + Connect :mongosh:`mongosh ` to one of the replica set members. action: copyable: true language: sh 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 fa29b40d561..540f7253d62 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 @@ -159,8 +159,8 @@ action: code: | mongo -u joe -password -authenticationDatabase foo --host mongoRepl/mongo1.example.net:27017, mongo2.example.net:27017, mongo3.example.net:27017 post: | - If you do not specify the password to the :option:`-p ` - command-line option, the :binary:`~bin.mongo` shell prompts for the + If you do not specify the password to the :option:`-p ` + command-line option, :mongosh:`mongosh ` prompts for the password. - pre: | @@ -214,8 +214,9 @@ pre: | action: - heading: Shut down the secondary or arbiter members. pre: | - From a :binary:`~bin.mongo` shell connected to the secondary or arbiter, - issue the :method:`db.shutdownServer()` against the ``admin`` database. + From a :mongosh:`mongosh ` session that is connected to the + secondary or arbiter, issue the :method:`db.shutdownServer()` + against the ``admin`` database. language: javascript code: | @@ -290,8 +291,8 @@ action: - heading: Step down the primary replica set member pre: | - Connect to the primary using a :binary:`~bin.mongo` shell and step down the - primary using the :method:`rs.stepDown()` method. + Connect to the primary using :mongosh:`mongosh ` and step down + the primary using the :method:`rs.stepDown()` method. language: javascript code: | @@ -303,8 +304,9 @@ action: Once the primary steps down and the replica set elects a new primary, 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. + From a :mongosh:`mongosh ` session that is connected to the old + primary, issue the :method:`db.shutdownServer()` on the ``admin`` + database. language: javascript code: | @@ -372,7 +374,7 @@ action: - heading: Shut down the secondary or arbiter members pre: | - Connect a :binary:`~bin.mongo` shell to the secondary or arbiter, and + Connect :mongosh:`mongosh ` to the secondary or arbiter, and issue the :method:`db.shutdownServer()` on the ``admin`` database. language: javascript @@ -447,8 +449,8 @@ action: - heading: Step down the primary replica set member pre: | - Connect to the primary using a :binary:`~bin.mongo` shell and step down the - primary using the :method:`rs.stepDown()` method. + Connect to the primary using :mongosh:`mongosh ` and step down + the primary using the :method:`rs.stepDown()` method. language: javascript code: | @@ -460,8 +462,9 @@ action: Once the primary steps down and the replica set elects a new primary, 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. + From a :mongosh:`mongosh ` session that is connected to the old + primary, issue the :method:`db.shutdownServer()` on the ``admin`` + database. language: javascript code: | diff --git a/source/includes/steps-enable-authentication-in-replica-set.yaml b/source/includes/steps-enable-authentication-in-replica-set.yaml index 7c8efe4949e..0b22d1edf34 100644 --- a/source/includes/steps-enable-authentication-in-replica-set.yaml +++ b/source/includes/steps-enable-authentication-in-replica-set.yaml @@ -24,8 +24,8 @@ pre: | The :term:`primary` must be the *last* member shut down to avoid potential rollbacks. - To shut down a :binary:`~bin.mongod`, connect each :binary:`~bin.mongod` using a - :binary:`~bin.mongo` shell and issue the :method:`db.shutdownServer()` on the + To shut down a :binary:`~bin.mongod`, connect each :binary:`~bin.mongod` using + :mongosh:`mongosh ` and issue the :method:`db.shutdownServer()` on the ``admin`` database: action: language: sh @@ -58,14 +58,14 @@ title: Connect to the primary using the localhost interface. level: 4 ref: connect-via-localhost pre: | - Connect a :binary:`~bin.mongo` shell to one of the + Connect :mongosh:`mongosh ` to one of the :binary:`~bin.mongod` instances over the :ref:`localhost - interface`. You must run the :binary:`~bin.mongo` - shell on the same physical machine as the :binary:`~bin.mongod` instance. + interface`. You must run :mongosh:`mongosh ` + on the same physical machine as the :binary:`~bin.mongod` instance. Use :method:`rs.status()` to identify the :term:`primary` replica set member. If you are connected to the primary, continue to the next - step. If not, connect a :binary:`~bin.mongo` shell to the primary + step. If not, connect :mongosh:`mongosh ` to the primary over the :ref:`localhost interface`. 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 579ac7c9f22..c861ee93cc9 100644 --- a/source/includes/steps-enable-authentication-in-shardcluster-nodowntime-uac.yaml +++ b/source/includes/steps-enable-authentication-in-shardcluster-nodowntime-uac.yaml @@ -91,8 +91,8 @@ pre: | .. example:: - The following operation connects to the sharded cluster using the - :binary:`~bin.mongo` shell, authenticating as the user ``joe`` on the + The following operation connects to the sharded cluster using + :mongosh:`mongosh `, authenticating as the user ``joe`` on the ``marketing`` database. .. code-block:: javascript diff --git a/source/includes/steps-enable-authentication-in-sharded-cluster.yaml b/source/includes/steps-enable-authentication-in-sharded-cluster.yaml index e4464a94d60..57142222952 100644 --- a/source/includes/steps-enable-authentication-in-sharded-cluster.yaml +++ b/source/includes/steps-enable-authentication-in-sharded-cluster.yaml @@ -24,7 +24,7 @@ stepnum: 3 ref: disable-balancer level: 4 pre: | - Connect a :binary:`~bin.mongo` shell to a :binary:`~bin.mongos`. + Connect :mongosh:`mongosh ` to a :binary:`~bin.mongos`. action: - pre: | language: sh @@ -54,7 +54,7 @@ stepnum: 4 ref: shutdown-mongos level: 4 pre: | - Connect a :binary:`~bin.mongo` shell to each :binary:`~bin.mongos` and shut + Connect :mongosh:`mongosh ` to each :binary:`~bin.mongos` and shut them down. Use the :method:`db.shutdownServer()` method on the ``admin`` database @@ -75,7 +75,7 @@ stepnum: 5 ref: shutdown-config-servers level: 4 pre: | - Connect a :binary:`~bin.mongo` shell to each :binary:`~bin.mongod` in the + Connect :mongosh:`mongosh ` to each :binary:`~bin.mongod` in the config server deployment and shut them down. For replica set config server deployments, shut down the :term:`primary` @@ -95,7 +95,7 @@ stepnum: 6 ref: shutdown-shard-servers level: 4 pre: | - For each shard replica set, connect a :binary:`~bin.mongo` shell to each + For each shard replica set, connect :mongosh:`mongosh ` to each :binary:`~bin.mongod` member in the replica set and shut them down. Shut down the :term:`primary` member last. @@ -253,11 +253,11 @@ pre: | or modify users with new privileges, and therefore unable to access certain functions or operations. - For each shard replica set in the cluster, connect a :binary:`~bin.mongo` - shell to the :term:`primary` member over the :ref:`localhost - interface`. You must run the :binary:`~bin.mongo` on - the same machine as the target :binary:`~bin.mongod` to use the localhost - interface. + For each shard replica set in the cluster, connect + :mongosh:`mongosh ` to the :term:`primary` member over the + :ref:`localhost interface`. You must run + :mongosh:`mongosh ` on the same machine as the target + :binary:`~bin.mongod` to use the localhost interface. Create a user with the ``userAdminAnyDatabase`` role on the ``admin`` database. This user can create @@ -337,7 +337,7 @@ action: post: | At this point, the entire sharded cluster is back online and can communicate internally using the keyfile specified. However, external - programs like the :binary:`~bin.mongo` shell need to use a correctly + programs like :mongosh:`mongosh ` need to use a correctly provisioned user in order to read or write to the cluster. --- title: Connect to the :binary:`~bin.mongos` instance over the localhost interface. @@ -389,8 +389,9 @@ level: 4 pre: | To perform sharding operations, authenticate as a :authrole:`clusterAdmin` user with either the - :method:`db.auth()` method or a new :binary:`~bin.mongo` shell with the - ``username``, ``password``, and ``authenticationDatabase`` parameters. + :method:`db.auth()` method or a new :mongosh:`mongosh ` session + with the ``username``, ``password``, and ``authenticationDatabase`` + parameters. .. note:: diff --git a/source/includes/steps-kerberos-auth-activedirectory-authz.yaml b/source/includes/steps-kerberos-auth-activedirectory-authz.yaml index 82dd729b6dc..4edcc45cbc3 100644 --- a/source/includes/steps-kerberos-auth-activedirectory-authz.yaml +++ b/source/includes/steps-kerberos-auth-activedirectory-authz.yaml @@ -92,8 +92,8 @@ ref: security-nativeldap-activedirectory-preconnect level: 4 pre: | - Connect to the MongoDB server using the :binary:`~bin.mongo` shell using the - :option:`--host ` and :option:`--port ` options. + Connect to the MongoDB server using :mongosh:`mongosh ` using the + :option:`--host ` and :option:`--port ` options. .. code-block:: bash @@ -103,7 +103,7 @@ pre: | authenticate to the ``admin`` database as a user with role management privileges, such as those provided by :authrole:`userAdmin` or :authrole:`userAdminAnyDatabase`. Include the appropriate - :option:`--authenticationMechanism ` for the + :option:`--authenticationMechanism ` for the MongoDB server's configured authentication mechanism. .. code-block:: bash @@ -112,7 +112,7 @@ pre: | .. note:: - For :abbr:`Windows (Microsoft Windows)` MongoDB deployments, you should replace :binary:`~bin.mongo` with + For :abbr:`Windows (Microsoft Windows)` MongoDB deployments, you should replace :mongosh:`mongosh ` with :binary:`mongo.exe ` --- @@ -476,15 +476,15 @@ pre: | database with :authrole:`userAdmin`, :authrole:`userAdminAnyDatabase`, or a custom role with equivalent privileges. - Use the :binary:`~bin.mongo` shell to authenticate to the MongoDB + Use :mongosh:`mongosh ` to authenticate to the MongoDB server, set the following options: - - :option:`--host ` with the hostname of the MongoDB server - - :option:`--port ` with the port of the MongoDB server - - :option:`--username ` to the user's ``userPrincipalName`` - - :option:`--password ` to the user's password (or omit to have the :binary:`~bin.mongo` shell prompt for the password) - - :option:`--authenticationMechanism ` to ``"GSSAPI"`` - - :option:`--authenticationDatabase ` to ``"$external"`` + - :option:`--host ` with the hostname of the MongoDB server + - :option:`--port ` with the port of the MongoDB server + - :option:`--username ` to the user's ``userPrincipalName`` + - :option:`--password ` to the user's password (or omit to have :mongosh:`mongosh ` prompt for the password) + - :option:`--authenticationMechanism ` to ``"GSSAPI"`` + - :option:`--authenticationDatabase ` to ``"$external"`` .. example:: @@ -499,12 +499,12 @@ pre: | mongo --username sam@DBA.EXAMPLE.COM --password --authenticationMechanisms="GSSAPI" --authenticationDatabase "$external" --host --port - If you do not specify the password to the :option:`-p ` command-line option, the :binary:`~bin.mongo` shell + If you do not specify the password to the :option:`-p ` command-line option, :mongosh:`mongosh ` prompts for the password. :abbr:`Windows (Microsoft Windows)` MongoDB deployments must use - :binary:`mongo.exe ` instead of :binary:`~bin.mongo`. + :binary:`mongo.exe ` instead of :mongosh:`mongosh `. Given the configured :ref:`Active Directory users `, the user authenticates successfully and @@ -513,7 +513,7 @@ pre: | .. note:: If you want to authenticate as an existing non-``$external`` user, set - :option:`--authenticationMechanism ` to a SCRAM authentication mechanism (e.g. ``SCRAM-SHA-1`` or ``SCRAM-SHA-256``). This requires + :option:`--authenticationMechanism ` to a SCRAM authentication mechanism (e.g. ``SCRAM-SHA-1`` or ``SCRAM-SHA-256``). This requires that the MongoDB server's :setting:`setParameter` :parameter:`authenticationMechanisms` includes ``SCRAM-SHA-1`` and/or ``SCRAM-SHA-256`` as appropriate. --- diff --git a/source/includes/steps-log-rotate-rename.yaml b/source/includes/steps-log-rotate-rename.yaml index e9d3378f4ab..7b76ef30a49 100644 --- a/source/includes/steps-log-rotate-rename.yaml +++ b/source/includes/steps-log-rotate-rename.yaml @@ -26,7 +26,7 @@ ref: rotate-log title: Rotate the log file. pre: | Rotate the log file by issuing the :dbcommand:`logRotate` command - from the ``admin`` database in a :binary:`~bin.mongo` shell: + from the ``admin`` database in :mongosh:`mongosh `: action: language: sh code: | diff --git a/source/includes/steps-perform-maintenance-task-on-replica-set-members.yaml b/source/includes/steps-perform-maintenance-task-on-replica-set-members.yaml index fc78dd01cb7..3455e4e4a0a 100644 --- a/source/includes/steps-perform-maintenance-task-on-replica-set-members.yaml +++ b/source/includes/steps-perform-maintenance-task-on-replica-set-members.yaml @@ -2,7 +2,7 @@ title: Stop a secondary. stepnum: 1 ref: stop-a-secondary pre: | - In the :binary:`~bin.mongo` shell, shut down the :binary:`~bin.mongod` instance: + In :mongosh:`mongosh `, shut down the :binary:`~bin.mongod` instance: action: language: javascript code: db.shutdownServer() @@ -110,7 +110,7 @@ title: Perform maintenance operations on the secondary. stepnum: 3 ref: maintenance-on-secondary pre: | - While the member is a standalone, use the :binary:`~bin.mongo` shell to + While the member is a standalone, use :mongosh:`mongosh ` to perform maintenance: action: language: sh @@ -136,7 +136,7 @@ pre: | on its usual port. action: - pre: | - From the :binary:`~bin.mongo` shell, shut down the standalone + From :mongosh:`mongosh `, shut down the standalone server after completing the maintenance: language: javascript code: | @@ -156,12 +156,12 @@ action: For shard or config server members, be sure to remove the :parameter:`skipShardingConfigurationChecks` parameter. - When it has started, connect the :binary:`~bin.mongo` shell to the + When it has started, connect :mongosh:`mongosh ` to the restarted instance. - pre: | The secondary takes time to :doc:`catch up to the primary - `. From the :binary:`~bin.mongo` shell, use the + `. From :mongosh:`mongosh `, use the following command to verify that the member has caught up from the :replstate:`RECOVERING` state to the :replstate:`SECONDARY` state. language: javascript @@ -173,8 +173,8 @@ ref: maintenance-on-primary content: | a. To perform maintenance on the primary after completing - maintenance tasks on all secondaries, connect a - :binary:`~bin.mongo` shell to the primary and use + maintenance tasks on all secondaries, connect + :mongosh:`mongosh ` to the primary and use :method:`rs.stepDown()` to step down the primary and allow one of the secondaries to be elected the new primary. Specify a 300 second waiting period to prevent the member from being elected diff --git a/source/includes/steps-replace-disabled-config-server.yaml b/source/includes/steps-replace-disabled-config-server.yaml index b71fc4e867f..555a2f73f9a 100644 --- a/source/includes/steps-replace-disabled-config-server.yaml +++ b/source/includes/steps-replace-disabled-config-server.yaml @@ -16,7 +16,7 @@ action: title: Add the new config server to the replica set. ref: add-to-replica-set pre: | - Connect a :binary:`~bin.mongo` shell to the primary of the config server + Connect :mongosh:`mongosh ` to the primary of the config server replica set and use :method:`rs.add()` to add the new member. .. warning:: @@ -75,8 +75,8 @@ title: Remove the member to replace from the config server replica set. ref: remove-old-member pre: | Upon completion of initial sync of the replacement config server, - from a :binary:`~bin.mongo` shell connected to the primary, use - :method:`rs.remove()` to remove the old member. + from a :mongosh:`mongosh ` session that is connected to the + primary, use :method:`rs.remove()` to remove the old member. action: language: javascript code: | diff --git a/source/includes/steps-restore-primary-from-backup.yaml b/source/includes/steps-restore-primary-from-backup.yaml index b09c250500a..a2749184653 100644 --- a/source/includes/steps-restore-primary-from-backup.yaml +++ b/source/includes/steps-restore-primary-from-backup.yaml @@ -25,7 +25,7 @@ action: mongod --dbpath /data/db - heading: Drop the ``local`` database. pre: | - Connect :binary:`~bin.mongo` shell to the :binary:`~bin.mongod` + Connect :mongosh:`mongosh ` to the :binary:`~bin.mongod` instance and drop the ``local`` database. language: javascript @@ -63,7 +63,7 @@ post: | .. include:: /includes/fact-uuid-restore-from-backup.rst --- -title: Connect a :binary:`~bin.mongo` shell to the ``mongod`` instance. +title: Connect :mongosh:`mongosh ` to the ``mongod`` instance. stepnum: 4 source: file: steps-deploy-replica-set.yaml diff --git a/source/includes/steps-restore-secondary-from-backup-directly.yaml b/source/includes/steps-restore-secondary-from-backup-directly.yaml index 34d16ef98e6..35585ecd35e 100644 --- a/source/includes/steps-restore-secondary-from-backup-directly.yaml +++ b/source/includes/steps-restore-secondary-from-backup-directly.yaml @@ -20,8 +20,9 @@ title: Add the secondaries to the replica set. stepnum: 4 ref: add content: | - In a :binary:`~bin.mongo` shell connected to the :term:`primary`, add the - :term:`secondaries ` to the replica set using - :method:`rs.add()`. See :doc:`/tutorial/deploy-replica-set` for more - information about deploying a replica set. + In a :mongosh:`mongosh ` session that is connected to the + :term:`primary`, add the :term:`secondaries ` to the + replica set using the :method:`rs.add()` method. See + :doc:`/tutorial/deploy-replica-set` for more information about + deploying a replica set. ... diff --git a/source/includes/steps-run-mongodb-on-linux-tarball.yaml b/source/includes/steps-run-mongodb-on-linux-tarball.yaml index d14e49ebf73..61891ca4d5f 100644 --- a/source/includes/steps-run-mongodb-on-linux-tarball.yaml +++ b/source/includes/steps-run-mongodb-on-linux-tarball.yaml @@ -60,8 +60,8 @@ title: Begin using MongoDB. ref: begin-using-mongodb pre: | - Start a :binary:`~bin.mongo` shell on the same host machine as the - :binary:`~bin.mongod`. You can run the :binary:`~bin.mongo` shell + Start a :mongosh:`mongosh ` session on the same host machine as the + :binary:`~bin.mongod`. You can run :mongosh:`mongosh ` without any command-line options to connect to a :binary:`~bin.mongod` that is running on your localhost with default port 27017: @@ -73,9 +73,10 @@ action: mongo post: | - For more information on connecting using the :binary:`~bin.mongo` - shell, such as to connect to a :binary:`~bin.mongod` instance running - on a different host and/or port, see :doc:`/reference/mongo`. + For more information on connecting using :mongosh:`mongosh `, + such as to connect to a :binary:`~bin.mongod` instance running + on a different host and/or port, see the + :mongosh:`mongosh documentation `. To help you start using MongoDB, MongoDB provides :ref:`Getting Started Guides ` in various driver editions. For the @@ -83,5 +84,5 @@ post: | replacement: mongod: ":binary:`~bin.mongod`" - mongo: ":binary:`~bin.mongo`" + mongo: ":mongosh:`mongosh `" ... diff --git a/source/includes/steps-run-mongodb-on-linux.yaml b/source/includes/steps-run-mongodb-on-linux.yaml index 769712e6e74..36cd91ba92d 100644 --- a/source/includes/steps-run-mongodb-on-linux.yaml +++ b/source/includes/steps-run-mongodb-on-linux.yaml @@ -82,8 +82,8 @@ stepnum: 5 ref: begin-using-mongodb pre: | - Start a :binary:`~bin.mongo` shell on the same host machine as the - :binary:`~bin.mongod`. You can run the :binary:`~bin.mongo` shell + Start a :mongosh:`mongosh ` session on the same host machine as the + :binary:`~bin.mongod`. You can run :mongosh:`mongosh ` without any command-line options to connect to a :binary:`~bin.mongod` that is running on your localhost with default port 27017: @@ -95,9 +95,10 @@ action: mongo post: | - For more information on connecting using the :binary:`~bin.mongo` - shell, such as to connect to a :binary:`~bin.mongod` instance running - on a different host and/or port, see :doc:`/reference/mongo`. + For more information on connecting using :mongosh:`mongosh `, + such as to connect to a :binary:`~bin.mongod` instance running + on a different host and/or port, see the + :mongosh:`mongosh documentation `. To help you start using MongoDB, MongoDB provides :ref:`Getting Started Guides ` in various driver editions. For the @@ -105,5 +106,5 @@ post: | replacement: mongod: ":binary:`~bin.mongod`" - mongo: ":binary:`~bin.mongo`" + mongo: ":mongosh:`mongosh `" ... diff --git a/source/includes/steps-run-mongodb-on-osx.yaml b/source/includes/steps-run-mongodb-on-osx.yaml index abffe807625..93a081b6008 100644 --- a/source/includes/steps-run-mongodb-on-osx.yaml +++ b/source/includes/steps-run-mongodb-on-osx.yaml @@ -101,8 +101,8 @@ title: Begin using MongoDB. stepnum: 6 ref: begin-using-mongodb pre: | - Start a :binary:`~bin.mongo` shell on the same host machine as the - :binary:`~bin.mongod`. You can run the :binary:`~bin.mongo` shell + Start a :mongosh:`mongosh ` session on the same host machine as the + :binary:`~bin.mongod`. You can run :mongosh:`mongosh ` without any command-line options to connect to a :binary:`~bin.mongod` that is running on your *localhost* with the default port of *27017*: @@ -116,9 +116,10 @@ post: | .. include:: /includes/extracts/macos-prevent-launch-mongo.rst - For more information on connecting using the :binary:`~bin.mongo` - shell, such as to connect to a :binary:`~bin.mongod` instance running - on a different host and/or port, see :doc:`/reference/mongo`. + For more information on connecting using :mongosh:`mongosh `, + such as to connect to a :binary:`~bin.mongod` instance running + on a different host and/or port, see the + :mongosh:`mongosh documentation `. To help you start using MongoDB, MongoDB provides :ref:`Getting Started Guides ` in various driver editions. See @@ -126,5 +127,5 @@ post: | replacement: mongod: ":binary:`~bin.mongod`" - mongo: ":binary:`~bin.mongo`" + mongo: ":mongosh:`mongosh `" ... diff --git a/source/includes/steps-run-mongodb-on-windows.yaml b/source/includes/steps-run-mongodb-on-windows.yaml index 0625aaa2182..a624ad474c1 100644 --- a/source/includes/steps-run-mongodb-on-windows.yaml +++ b/source/includes/steps-run-mongodb-on-windows.yaml @@ -66,8 +66,8 @@ content: | For more information on connecting a :binary:`mongo.exe ` shell, such as to connect to a MongoDB instance running on a different - host and/or port, see :doc:`/reference/mongo`. For information on CRUD - (Create,Read,Update,Delete) operations, see: + host and/or port, see the :mongosh:`mongosh documentation `. For + information on CRUD (Create,Read,Update,Delete) operations, see: - :doc:`/tutorial/insert-documents` - :doc:`/tutorial/query-documents` diff --git a/source/includes/steps-schedule-balancer-window.yaml b/source/includes/steps-schedule-balancer-window.yaml index 701210bd423..af4e2f8d477 100644 --- a/source/includes/steps-schedule-balancer-window.yaml +++ b/source/includes/steps-schedule-balancer-window.yaml @@ -1,7 +1,7 @@ ref: connect-mongos stepnum: 1 level: 3 -title: "Connect to :binary:`~bin.mongos` using the :binary:`~bin.mongo` shell." +title: "Connect to :binary:`~bin.mongos` using :mongosh:`mongosh `." content: | You can connect to any :binary:`~bin.mongos` in the cluster. --- diff --git a/source/includes/steps-shard-a-collection-ranged.yaml b/source/includes/steps-shard-a-collection-ranged.yaml index 6c2dc839902..21f11b9c674 100644 --- a/source/includes/steps-shard-a-collection-ranged.yaml +++ b/source/includes/steps-shard-a-collection-ranged.yaml @@ -6,7 +6,7 @@ pre: | Connect to a :binary:`~bin.mongos` instance. action: - pre: | - Using the :binary:`~bin.mongo` shell, use the ``--hostname`` parameter + Using :mongosh:`mongosh `, use the ``--hostname`` parameter passing the hostname of the target machine, and the ``--port`` parameter passing the port the :binary:`~bin.mongos` listens on. language: javascript diff --git a/source/includes/steps-test-generate-multiple-documents.yaml b/source/includes/steps-test-generate-multiple-documents.yaml index 5d1b9ecc4cb..7e6167180c2 100644 --- a/source/includes/steps-test-generate-multiple-documents.yaml +++ b/source/includes/steps-test-generate-multiple-documents.yaml @@ -2,7 +2,7 @@ title: Insert new documents into the ``testData`` collection. stepnum: 1 ref: insert-new-documents pre: | - From the :binary:`~bin.mongo` shell, use the ``for`` loop. If the ``testData`` + From :mongosh:`mongosh `, use the ``for`` loop. If the ``testData`` collection does not exist, MongoDB will implicitly create the collection. action: language: javascript @@ -21,7 +21,7 @@ action: code: | db.testData.find() - pre: | - The :binary:`~bin.mongo` shell displays the first 20 documents in the + :mongosh:`mongosh ` displays the first 20 documents in the collection. Your :doc:`ObjectId ` values will be different: language: javascript @@ -54,7 +54,7 @@ ref: iterate-cursor pre: | The :method:`~db.collection.find()` method returns a cursor. To :doc:`iterate the cursor ` and return more - documents, type ``it`` in the :binary:`~bin.mongo` shell. The shell will + documents, type ``it`` in :mongosh:`mongosh `. The shell will exhaust the cursor and return these documents: action: language: javascript diff --git a/source/includes/steps-upgrade-enterprise-replica-set.yaml b/source/includes/steps-upgrade-enterprise-replica-set.yaml index fa528585741..77eb952bb02 100644 --- a/source/includes/steps-upgrade-enterprise-replica-set.yaml +++ b/source/includes/steps-upgrade-enterprise-replica-set.yaml @@ -22,7 +22,7 @@ ref: upgrade-enterprise-rs-step-down-primary content: | Once all the secondary members have been upgraded to Enterprise, - connect a :binary:`~bin.mongo` shell to the primary and use + connect :mongosh:`mongosh ` to the primary and use :method:`rs.stepDown()` to step down the primary and force an election of a new primary. diff --git a/source/includes/steps-upgrade-enterprise-sharded-cluster.yaml b/source/includes/steps-upgrade-enterprise-sharded-cluster.yaml index b3589d23a0f..7d5206677aa 100644 --- a/source/includes/steps-upgrade-enterprise-sharded-cluster.yaml +++ b/source/includes/steps-upgrade-enterprise-sharded-cluster.yaml @@ -3,7 +3,7 @@ level: 4 ref: upgrade-enterprise-disable-balancer content: | - Connect a :binary:`~bin.mongo` shell to a :binary:`~bin.mongos` instance in + Connect :mongosh:`mongosh ` to a :binary:`~bin.mongos` instance in the sharded cluster, and run :method:`sh.stopBalancer()` to disable the balancer: @@ -47,13 +47,13 @@ content: |- #. Wait for the member to recover to ``SECONDARY`` state before upgrading the next secondary member. To check the member's state, - issue :method:`rs.status()` in the :binary:`~bin.mongo` shell. + issue :method:`rs.status()` in :mongosh:`mongosh `. Repeat for each remaining secondary member. #. Step down the replica set primary. - Connect a :binary:`~bin.mongo` shell to the primary and use + Connect :mongosh:`mongosh ` to the primary and use :method:`rs.stepDown()` to step down the primary and force an election of a new primary: @@ -91,13 +91,13 @@ content: |- #. Wait for the member to recover to ``SECONDARY`` state before upgrading the next secondary member. To check the member's state, - issue :method:`rs.status()` in the :binary:`~bin.mongo` shell. + issue :method:`rs.status()` in :mongosh:`mongosh `. Repeat for each remaining secondary member. #. Step down the replica set primary. - Connect a :binary:`~bin.mongo` shell to the primary and use + Connect :mongosh:`mongosh ` to the primary and use :method:`rs.stepDown()` to step down the primary and force an election of a new primary: @@ -129,7 +129,7 @@ level: 4 ref: upgrade-enterprise-reenable-balancer content: |- - Using a :binary:`~bin.mongo` shell, connect to a + Using :mongosh:`mongosh `, connect to a :binary:`~bin.mongos` in the cluster and run :method:`sh.startBalancer()` to re-enable the balancer: diff --git a/source/reference/bson-types.txt b/source/reference/bson-types.txt index 01501224d57..61f039a8576 100644 --- a/source/reference/bson-types.txt +++ b/source/reference/bson-types.txt @@ -58,7 +58,7 @@ MongoDB clients should add an ``_id`` field with a unique ObjectId. Using ObjectIds for the ``_id`` field provides the following additional benefits: -- in the :binary:`~bin.mongo` shell, you can access the creation time of +- in :mongosh:`mongosh `, you can access the creation time of the ``ObjectId``, using the :method:`ObjectId.getTimestamp()` method. - sorting on an ``_id`` field that stores ``ObjectId`` values is @@ -164,15 +164,15 @@ refers to the BSON Date type as the *UTC datetime*. BSON Date type is signed. [#unsigned-date]_ Negative values represent dates before 1970. -.. example:: Construct a Date using the ``new Date()`` constructor in the - :binary:`~bin.mongo` shell: +.. example:: Construct a Date using the ``new Date()`` constructor in + :mongosh:`mongosh `: .. code-block:: javascript var mydate1 = new Date() -.. example:: Construct a Date using the ``ISODate()`` constructor in the - :binary:`~bin.mongo` shell: +.. example:: Construct a Date using the ``ISODate()`` constructor in + :mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/reference/command.txt b/source/reference/command.txt index 085baf5cd5f..f89cb2620cb 100644 --- a/source/reference/command.txt +++ b/source/reference/command.txt @@ -15,7 +15,7 @@ Database Commands All command documentation outlined below describes a command and its available parameters and provides a document template or prototype for each command. Some command documentation also includes the relevant -:binary:`~bin.mongo` shell helpers. +:mongosh:`mongosh ` helpers. To run a command against the current database, use :method:`db.runCommand()`: diff --git a/source/reference/command/abortTransaction.txt b/source/reference/command/abortTransaction.txt index 673d0445018..213a3d748e6 100644 --- a/source/reference/command/abortTransaction.txt +++ b/source/reference/command/abortTransaction.txt @@ -27,7 +27,7 @@ Definition against the ``admin`` database and run within a :method:`Session`. Rather than run the :dbcommand:`abortTransaction` command directly, most users should use the driver method or the - :binary:`~bin.mongo` shell :method:`Session.abortTransaction()` + :mongosh:`mongosh ` :method:`Session.abortTransaction()` helper. The command has the following syntax: diff --git a/source/reference/command/addShardToZone.txt b/source/reference/command/addShardToZone.txt index 5b2c424e350..5aff057cecc 100644 --- a/source/reference/command/addShardToZone.txt +++ b/source/reference/command/addShardToZone.txt @@ -75,7 +75,7 @@ The command takes the following fields: `. -The :binary:`~bin.mongo` shell provides the helper method +:mongosh:`mongosh ` provides the helper method :method:`sh.addShardToZone()` Behavior diff --git a/source/reference/command/aggregate.txt b/source/reference/command/aggregate.txt index 7e62d45d09b..336e8466e8a 100644 --- a/source/reference/command/aggregate.txt +++ b/source/reference/command/aggregate.txt @@ -49,7 +49,7 @@ The command has following syntax: Rather than run the :dbcommand:`aggregate` command directly, most users should use the :method:`db.collection.aggregate()` helper - provided in the :binary:`~bin.mongo` shell or the equivalent helper in + provided in :mongosh:`mongosh ` or the equivalent helper in their driver. In 2.6 and later, the :method:`db.collection.aggregate()` helper always returns a cursor. @@ -315,7 +315,7 @@ Example Rather than run the :dbcommand:`aggregate` command directly, most users should use the :method:`db.collection.aggregate()` helper - provided in the :binary:`~bin.mongo` shell or the equivalent helper in + provided in :mongosh:`mongosh ` or the equivalent helper in their driver. In 2.6 and later, the :method:`db.collection.aggregate()` helper always returns a cursor. @@ -353,7 +353,7 @@ element in the ``tags`` array that appears in the collection. cursor: { } } ) -In the :binary:`~bin.mongo` shell, this operation can use the +In :mongosh:`mongosh `, this operation can use the :method:`db.collection.aggregate()` helper as in the following: .. code-block:: javascript diff --git a/source/reference/command/authenticate.txt b/source/reference/command/authenticate.txt index 01503c8102a..ecb055f5260 100644 --- a/source/reference/command/authenticate.txt +++ b/source/reference/command/authenticate.txt @@ -13,7 +13,7 @@ authenticate .. dbcommand:: authenticate Authenticates using the x.509 authentication mechanism. When using - the :binary:`~bin.mongo` shell, use the :method:`db.auth()` helper + :mongosh:`mongosh `, use the :method:`db.auth()` helper as follows: .. tip:: diff --git a/source/reference/command/balancerCollectionStatus.txt b/source/reference/command/balancerCollectionStatus.txt index 955b345171f..e199143823d 100644 --- a/source/reference/command/balancerCollectionStatus.txt +++ b/source/reference/command/balancerCollectionStatus.txt @@ -34,7 +34,7 @@ Definition Specify the full namespace (".") of the sharded collection. - The :binary:`~bin.mongo` shell provides a wrapper method + :mongosh:`mongosh ` provides a wrapper method :method:`sh.balancerCollectionStatus()`. Access Control diff --git a/source/reference/command/buildInfo.txt b/source/reference/command/buildInfo.txt index e42ae47a80e..bca4894d962 100644 --- a/source/reference/command/buildInfo.txt +++ b/source/reference/command/buildInfo.txt @@ -21,7 +21,7 @@ buildInfo { buildInfo: 1 } - In the :binary:`~bin.mongo` shell, call :dbcommand:`buildInfo` in the + In :mongosh:`mongosh `, call :dbcommand:`buildInfo` in the following form: .. code-block:: javascript diff --git a/source/reference/command/commitTransaction.txt b/source/reference/command/commitTransaction.txt index 93f5e06b21a..10be1020145 100644 --- a/source/reference/command/commitTransaction.txt +++ b/source/reference/command/commitTransaction.txt @@ -24,7 +24,7 @@ Definition against the ``admin`` database and run within a :method:`Session`. Rather than run the :dbcommand:`commitTransaction` command directly, most users should use the driver method or the - :binary:`~bin.mongo` shell :method:`Session.commitTransaction()` + :mongosh:`mongosh ` :method:`Session.commitTransaction()` helper. The command has the following syntax: diff --git a/source/reference/command/count.txt b/source/reference/command/count.txt index 7c086a96d24..f495203222b 100644 --- a/source/reference/command/count.txt +++ b/source/reference/command/count.txt @@ -133,7 +133,7 @@ Definition - The :binary:`~bin.mongo` shell also provides the following wrapper methods for :dbcommand:`count`: + :mongosh:`mongosh ` also provides the following wrapper methods for :dbcommand:`count`: - :method:`~cursor.count()` - :method:`db.collection.estimatedDocumentCount()` diff --git a/source/reference/command/createIndexes.txt b/source/reference/command/createIndexes.txt index df73ec24136..12de222c8a6 100644 --- a/source/reference/command/createIndexes.txt +++ b/source/reference/command/createIndexes.txt @@ -506,7 +506,7 @@ Definition - The :binary:`~bin.mongo` shell provides the methods + :mongosh:`mongosh ` provides the methods :method:`db.collection.createIndex()` and :method:`db.collection.createIndexes()` as wrappers for the :dbcommand:`createIndexes` command. @@ -529,7 +529,7 @@ Index Names .. include:: /includes/extracts/4.2-changes-index-names.rst Starting in version 4.2, the :dbcommand:`createIndexes` command and -the :binary:`~bin.mongo` shell helpers +:mongosh:`mongosh ` helpers :method:`db.collection.createIndex()` and :method:`db.collection.createIndexes()` report an error if you create an index with one name, and then try to create the same index @@ -655,7 +655,7 @@ Hidden Option ` set to ``4.2`` on MongoDB 4.4 binaries. To change the ``hidden`` option for existing indexes, you can use the -following :binary:`~bin.mongo` shell methods: +following :mongosh:`mongosh ` methods: - :method:`db.collection.hideIndex()` diff --git a/source/reference/command/currentOp.txt b/source/reference/command/currentOp.txt index 44c977c97d3..de46352a260 100644 --- a/source/reference/command/currentOp.txt +++ b/source/reference/command/currentOp.txt @@ -26,7 +26,7 @@ Definition { currentOp: 1 } - The :binary:`~bin.mongo` shell provides the :method:`db.currentOp()` + :mongosh:`mongosh ` provides the :method:`db.currentOp()` wrapper for the :dbcommand:`currentOp` command. .. note:: @@ -683,7 +683,7 @@ Output Fields .. data:: currentOp.opid The identifier for the operation. You can pass this value to - :method:`db.killOp()` in the :binary:`~bin.mongo` shell to terminate the + :method:`db.killOp()` in :mongosh:`mongosh ` to terminate the operation. .. include:: /includes/extracts/warning-terminating-ops-method.rst diff --git a/source/reference/command/dbStats.txt b/source/reference/command/dbStats.txt index 32f8e206f84..763be8963e4 100644 --- a/source/reference/command/dbStats.txt +++ b/source/reference/command/dbStats.txt @@ -58,7 +58,7 @@ Definition .. include:: /includes/extracts/4.2-changes-stats-scaleFactor.rst - In the :binary:`~bin.mongo` shell, the :method:`db.stats()` function + In :mongosh:`mongosh `, the :method:`db.stats()` function provides a wrapper around :dbcommand:`dbStats`. Behavior diff --git a/source/reference/command/delete.txt b/source/reference/command/delete.txt index 4b5b3a0e7e9..5e1ac15695a 100644 --- a/source/reference/command/delete.txt +++ b/source/reference/command/delete.txt @@ -380,7 +380,7 @@ Specify ``hint`` for Delete Operations .. versionadded:: 4.4 -From the :binary:`~bin.mongo` shell, create a ``members`` collection +In :mongosh:`mongosh `, create a ``members`` collection with the following documents: .. code-block:: javascript diff --git a/source/reference/command/drop.txt b/source/reference/command/drop.txt index 4d1a71345ce..116bdd5af27 100644 --- a/source/reference/command/drop.txt +++ b/source/reference/command/drop.txt @@ -45,7 +45,7 @@ drop .. versionadded:: 4.4 - The :binary:`~bin.mongo` shell provides the equivalent helper method + :mongosh:`mongosh ` provides the equivalent helper method :method:`db.collection.drop()`. Behavior diff --git a/source/reference/command/dropAllUsersFromDatabase.txt b/source/reference/command/dropAllUsersFromDatabase.txt index 8ca0c9fdcdc..8f1b201f741 100644 --- a/source/reference/command/dropAllUsersFromDatabase.txt +++ b/source/reference/command/dropAllUsersFromDatabase.txt @@ -82,7 +82,7 @@ Required Access Example ------- -The following sequence of operations in the :binary:`~bin.mongo` shell drops +The following sequence of operations in :mongosh:`mongosh ` drops every user from the ``products`` database: .. code-block:: javascript diff --git a/source/reference/command/dropDatabase.txt b/source/reference/command/dropDatabase.txt index 65fb398d8d6..4521cd5335b 100644 --- a/source/reference/command/dropDatabase.txt +++ b/source/reference/command/dropDatabase.txt @@ -62,7 +62,7 @@ Definition .. versionadded:: 4.4 - The :binary:`~bin.mongo` shell also provides the helper method + :mongosh:`mongosh ` also provides the helper method :method:`db.dropDatabase()`. Behavior @@ -125,7 +125,7 @@ dropped database. Example ------- -The following example in the :binary:`~bin.mongo` shell uses the ``use +The following example in :mongosh:`mongosh ` uses the ``use `` operation to switch the current database to the ``temp`` database and then uses the :dbcommand:`dropDatabase` command to drop the ``temp`` database: diff --git a/source/reference/command/dropIndexes.txt b/source/reference/command/dropIndexes.txt index 492b326d6f2..c598996a627 100644 --- a/source/reference/command/dropIndexes.txt +++ b/source/reference/command/dropIndexes.txt @@ -177,7 +177,7 @@ Examples db.runCommand( { dropIndexes: "collection", index: "age_1" }) - The :binary:`~bin.mongo` shell provides the helper methods + :mongosh:`mongosh ` provides the helper methods :method:`db.collection.dropIndex()` and :method:`db.collection.dropIndexes()`: diff --git a/source/reference/command/dropUser.txt b/source/reference/command/dropUser.txt index 817e911f8d3..a18a40b2f6f 100644 --- a/source/reference/command/dropUser.txt +++ b/source/reference/command/dropUser.txt @@ -80,7 +80,7 @@ Required Access Example ------- -The following sequence of operations in the :binary:`~bin.mongo` shell removes +The following sequence of operations in :mongosh:`mongosh ` removes ``reportUser1`` from the ``products`` database: .. code-block:: javascript diff --git a/source/reference/command/enableSharding.txt b/source/reference/command/enableSharding.txt index d18fd05edb1..8130b9820fa 100644 --- a/source/reference/command/enableSharding.txt +++ b/source/reference/command/enableSharding.txt @@ -20,7 +20,7 @@ Definition for a database, you can use the :dbcommand:`shardCollection` command to shard collections in that database. - The :binary:`~bin.mongo` shell method :method:`sh.enableSharding()` + The :mongosh:`mongosh ` method :method:`sh.enableSharding()` wraps the :dbcommand:`enableSharding` command. Syntax diff --git a/source/reference/command/find.txt b/source/reference/command/find.txt index d49b5f150fc..a92c15b59f6 100644 --- a/source/reference/command/find.txt +++ b/source/reference/command/find.txt @@ -23,8 +23,8 @@ Definition .. tip:: Rather than run the :dbcommand:`find` command directly, you can - use the :method:`db.collection.find()` helper provided in the - :binary:`~bin.mongo` shell or the equivalent helper in the + use the :method:`db.collection.find()` helper provided in + :mongosh:`mongosh ` or the equivalent helper in the drivers. Syntax @@ -597,7 +597,7 @@ the data confirmed as having been written to a majority of the nodes. The :dbcommand:`getMore` command uses the ``readConcern`` level specified in the originating :dbcommand:`find` command. -A ``readConcern`` can be specified for the :binary:`~bin.mongo` shell method +A ``readConcern`` can be specified for the :mongosh:`mongosh ` method :method:`db.collection.find()` using the :method:`cursor.readConcern` method: @@ -627,7 +627,7 @@ command with the collation specified: } ) -The :binary:`~bin.mongo` shell provides the :method:`cursor.collation()` to +:mongosh:`mongosh ` provides the :method:`cursor.collation()` to specify :ref:`collation ` for a :method:`db.collection.find()` operation. diff --git a/source/reference/command/findAndModify.txt b/source/reference/command/findAndModify.txt index 0beb1d759b0..fa021dfea4f 100644 --- a/source/reference/command/findAndModify.txt +++ b/source/reference/command/findAndModify.txt @@ -549,7 +549,7 @@ field: { "value" : null, "ok" : 1 } -The :binary:`~bin.mongo` shell and many :term:`drivers ` +:mongosh:`mongosh ` and many :term:`drivers ` provide a :method:`~db.collection.findAndModify()` helper method. Using the shell helper, this previous operation can take the following form: @@ -959,7 +959,7 @@ Specify ``hint`` for ``findAndModify`` Operations .. versionadded:: 4.4 -From the :binary:`~bin.mongo` shell, create a ``members`` collection +In :mongosh:`mongosh `, create a ``members`` collection with the following documents: .. code-block:: javascript diff --git a/source/reference/command/fsync.txt b/source/reference/command/fsync.txt index 7eb9844d411..5f5ea8b04c6 100644 --- a/source/reference/command/fsync.txt +++ b/source/reference/command/fsync.txt @@ -114,7 +114,7 @@ backup of the data set and the journal together as a single unit. in the return document. After ``{ fsync: 1, lock: true }`` runs on a :binary:`~bin.mongod`, all -write operations will block. The :binary:`~bin.mongo` shell provides a +write operations will block. :mongosh:`mongosh ` provides a helper method :method:`db.fsyncLock()`. @@ -205,8 +205,8 @@ currently locked: return false; } -After loading this function into your :binary:`~bin.mongo` shell session -call it, with the following syntax: +After loading this function into your :mongosh:`mongosh ` session, +call it with the following syntax: .. code-block:: javascript diff --git a/source/reference/command/fsyncUnlock.txt b/source/reference/command/fsyncUnlock.txt index a03790d6d7d..c0f5a2eb27f 100644 --- a/source/reference/command/fsyncUnlock.txt +++ b/source/reference/command/fsyncUnlock.txt @@ -70,7 +70,7 @@ Definition .. tip:: - The :binary:`~bin.mongo` shell provides the helper method + :mongosh:`mongosh ` provides the helper method :method:`db.fsyncUnlock()`. Examples diff --git a/source/reference/command/getFreeMonitoringStatus.txt b/source/reference/command/getFreeMonitoringStatus.txt index f65c98b21ce..4893907d34e 100644 --- a/source/reference/command/getFreeMonitoringStatus.txt +++ b/source/reference/command/getFreeMonitoringStatus.txt @@ -24,7 +24,7 @@ getFreeMonitoringStatus db.adminCommand( { getFreeMonitoringStatus: 1 } ) - The :binary:`~bin.mongo` shell provides the + :mongosh:`mongosh ` provides the :method:`db.getFreeMonitoringStatus()` helper for the command. Access Control diff --git a/source/reference/command/getLog.txt b/source/reference/command/getLog.txt index a060c586fd3..20ee293f91e 100644 --- a/source/reference/command/getLog.txt +++ b/source/reference/command/getLog.txt @@ -142,8 +142,8 @@ Outside the ``mongo`` Shell with ``jq`` .. include:: /includes/fact-use-jq-with-structured-logging.rst To use ``jq`` with :dbcommand:`getLog` output, you must use the -:option:`--eval ` option to the :binary:`~bin.mongo` -shell. The following operation uses ``jq`` to filter on the **REPL** +:option:`--eval ` option to :mongosh:`mongosh `. +The following operation uses ``jq`` to filter on the **REPL** :ref:`component ` to present only those log messages associated with replication: @@ -151,9 +151,9 @@ messages associated with replication: mongo --quiet --eval "db.adminCommand( { getLog:'global'} ).log.forEach(x => {print(x)})" | jq -c '. | select(.c=="REPL")' -Be sure to provide any necessary connection-specific parameters to the -:binary:`~bin.mongo` shell as needed, such as :option:`--host -` or :option:`--port `. +Be sure to provide any necessary connection-specific parameters to +:mongosh:`mongosh ` as needed, such as :option:`--host +` or :option:`--port `. See :ref:`log-message-parsing` for more examples of filtering log output using ``jq``. The ``jq`` syntax presented in each linked example can be @@ -171,7 +171,7 @@ Examples Retrieve Available Log Filters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The following operation, run from the :binary:`~bin.mongo` shell, +The following operation, run from :mongosh:`mongosh `, returns the available log filters for passing to :dbcommand:`getLog`: .. code-block:: javascript @@ -188,7 +188,7 @@ The operation returns the following document: Retrieve Recent Events from Log ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The following operation, run from the :binary:`~bin.mongo` shell, +The following operation, run from :mongosh:`mongosh `, retrieves the most recent ``global`` events for the :binary:`~bin.mongod`: diff --git a/source/reference/command/hello.txt b/source/reference/command/hello.txt index b04104a4192..423d7061f9c 100644 --- a/source/reference/command/hello.txt +++ b/source/reference/command/hello.txt @@ -58,7 +58,7 @@ add a log comment associated with the command. db.runCommand( { hello: 1, saslSupportedMechs: "", comment: } ) -The :method:`db.hello()` method in the :binary:`~bin.mongo` shell +The :method:`db.hello()` method in :mongosh:`mongosh ` provides a wrapper around :dbcommand:`hello`. Behavior diff --git a/source/reference/command/hostInfo.txt b/source/reference/command/hostInfo.txt index 0424319b6e0..261d57db06b 100644 --- a/source/reference/command/hostInfo.txt +++ b/source/reference/command/hostInfo.txt @@ -26,7 +26,7 @@ hostInfo db.hostInfo() db.adminCommand( { "hostInfo" : 1 } ) - In the :binary:`~bin.mongo` shell you can use :method:`db.hostInfo()` + In :mongosh:`mongosh ` you can use :method:`db.hostInfo()` as a helper to access :dbcommand:`hostInfo`. The output of :dbcommand:`hostInfo` on a Linux system will resemble the following: diff --git a/source/reference/command/killOp.txt b/source/reference/command/killOp.txt index 041019fe295..558f0c9acfe 100644 --- a/source/reference/command/killOp.txt +++ b/source/reference/command/killOp.txt @@ -18,7 +18,7 @@ Definition .. dbcommand:: killOp Terminates an operation as specified by the operation ID. - The :binary:`~bin.mongo` shell provides the + :mongosh:`mongosh ` provides the :method:`db.killOp()` helper. To find operations and their corresponding IDs, see :pipeline:`$currentOp` or :method:`db.currentOp()`. diff --git a/source/reference/command/listCollections.txt b/source/reference/command/listCollections.txt index 8fdb234e530..a657355836a 100644 --- a/source/reference/command/listCollections.txt +++ b/source/reference/command/listCollections.txt @@ -18,7 +18,7 @@ Definition Retrieve information, i.e. the name and options, about the collections and :doc:`views ` in a database. Specifically, the command returns a document that contains information with which to create a - cursor to the collection information. The :binary:`~bin.mongo` shell + cursor to the collection information. :mongosh:`mongosh ` provides the :method:`db.getCollectionInfos()` and the :method:`db.getCollectionNames()` helper methods. diff --git a/source/reference/command/listDatabases.txt b/source/reference/command/listDatabases.txt index a9bc8d8dc90..1872908530f 100644 --- a/source/reference/command/listDatabases.txt +++ b/source/reference/command/listDatabases.txt @@ -110,7 +110,7 @@ When :doc:`authentication ` is enabled: .. note:: - For :binary:`~bin.mongo` shell version 4.0.6+ connected to earlier + For :mongosh:`mongosh ` connected to earlier versions of MongoDB deployment (e.g. 3.6.10), - If the user has :authaction:`listDatabases` action on the cluster diff --git a/source/reference/command/listIndexes.txt b/source/reference/command/listIndexes.txt index 8b9e9f2648a..1460385b4a8 100644 --- a/source/reference/command/listIndexes.txt +++ b/source/reference/command/listIndexes.txt @@ -19,8 +19,8 @@ Definition including :doc:`hidden indexes `. Specifically, the command returns a document that contains information with which to create a cursor to the index information. Index information - includes the keys and options used to create the index. The - :binary:`~bin.mongo` shell provides the + includes the keys and options used to create the index. + :mongosh:`mongosh ` provides the :method:`db.collection.getIndexes()` helper. The command has the following form: diff --git a/source/reference/command/mapReduce.txt b/source/reference/command/mapReduce.txt index ad83ff5b21a..aa1924f92e8 100644 --- a/source/reference/command/mapReduce.txt +++ b/source/reference/command/mapReduce.txt @@ -395,7 +395,7 @@ associatd with :ref:`causally consistent sessions `. Map-Reduce Examples ------------------- -In the :binary:`~bin.mongo` shell, the :method:`db.collection.mapReduce()` +In :mongosh:`mongosh `, the :method:`db.collection.mapReduce()` method is a wrapper around the :dbcommand:`mapReduce` command. The following examples use the :method:`db.collection.mapReduce()` method: diff --git a/source/reference/command/reIndex.txt b/source/reference/command/reIndex.txt index 5424c370f30..f3e2f1a7793 100644 --- a/source/reference/command/reIndex.txt +++ b/source/reference/command/reIndex.txt @@ -44,7 +44,7 @@ Definition * - reIndex - The name of the collection to reindex. - The :binary:`~bin.mongo` shell provides a wrapper :method:`db.collection.reIndex()`. + :mongosh:`mongosh ` provides a wrapper :method:`db.collection.reIndex()`. Behavior -------- diff --git a/source/reference/command/removeShard.txt b/source/reference/command/removeShard.txt index 9a0dc36a5bb..3a09c8dc1a4 100644 --- a/source/reference/command/removeShard.txt +++ b/source/reference/command/removeShard.txt @@ -77,7 +77,7 @@ Change Streams Example ------- -From the :binary:`~bin.mongo` shell, the :dbcommand:`removeShard` +From :mongosh:`mongosh `, the :dbcommand:`removeShard` operation resembles the following: .. code-block:: javascript diff --git a/source/reference/command/removeShardFromZone.txt b/source/reference/command/removeShardFromZone.txt index 2e163432b42..e13d798fd56 100644 --- a/source/reference/command/removeShardFromZone.txt +++ b/source/reference/command/removeShardFromZone.txt @@ -74,7 +74,7 @@ The command takes the following fields: -The :binary:`~bin.mongo` shell provides the helper method +:mongosh:`mongosh ` provides the helper method :method:`sh.removeShardFromZone()`. Behavior diff --git a/source/reference/command/renameCollection.txt b/source/reference/command/renameCollection.txt index 3d226413a74..91b56c750df 100644 --- a/source/reference/command/renameCollection.txt +++ b/source/reference/command/renameCollection.txt @@ -199,7 +199,7 @@ The following example renames a collection named ``orders`` in the db.adminCommand( { renameCollection: "test.orders", to: "test.orders2014" } ) -The :binary:`~bin.mongo` shell provides the +:mongosh:`mongosh ` provides the :method:`db.collection.renameCollection()` helper for the command to rename collections within the *same* database. The following is equivalent to the previous example: diff --git a/source/reference/command/replSetGetConfig.txt b/source/reference/command/replSetGetConfig.txt index aaa11021e3c..36b45f20e7c 100644 --- a/source/reference/command/replSetGetConfig.txt +++ b/source/reference/command/replSetGetConfig.txt @@ -73,7 +73,7 @@ To run, :dbcommand:`replSetGetConfig` must be issued against the .. versionadded:: 4.4 -The :binary:`~bin.mongo` shell provides the :method:`rs.conf()` method +:mongosh:`mongosh ` provides the :method:`rs.conf()` method that wraps the :dbcommand:`replSetGetConfig` command: .. code-block:: javascript @@ -200,7 +200,7 @@ command run with :ref:`commitmentStatus: true If ``true``, then the configuration has been committed, and the replica set can be reconfigured. To reconfigure the replica set, see :dbcommand:`replSetReconfig` command or the - :binary:`~bin.mongo` shell method :method:`rs.reconfig()`. + :mongosh:`mongosh ` method :method:`rs.reconfig()`. If ``false``, then the configuration has not been committed, and the replica set cannot be reconfigured. diff --git a/source/reference/command/replSetGetStatus.txt b/source/reference/command/replSetGetStatus.txt index f14ceaea5ec..a1cc693451f 100644 --- a/source/reference/command/replSetGetStatus.txt +++ b/source/reference/command/replSetGetStatus.txt @@ -38,7 +38,7 @@ The command has the following syntax: - Starting in MongoDB 4.2.1 If you run :dbcommand:`replSetGetStatus` or the - :binary:`~bin.mongo` shell helper :method:`rs.status()` on a + :mongosh:`mongosh ` helper :method:`rs.status()` on a member during its :ref:`initial sync ` (i.e. :replstate:`STARTUP2` state), the command returns :data:`replSetGetStatus.initialSyncStatus` metrics. @@ -62,8 +62,8 @@ The command has the following syntax: ``initialSync: 1`` on the secondary member to return its initial sync information. - You cannot specify ``initialSync: 1`` in the :binary:`~bin.mongo` - shell helper :method:`rs.status()`. + You cannot specify ``initialSync: 1`` in the + :mongosh:`mongosh ` helper :method:`rs.status()`. .. _rs-status-output: diff --git a/source/reference/command/replSetResizeOplog.txt b/source/reference/command/replSetResizeOplog.txt index 9769c43d9d5..f4a567d1a62 100644 --- a/source/reference/command/replSetResizeOplog.txt +++ b/source/reference/command/replSetResizeOplog.txt @@ -230,7 +230,7 @@ Examples Change the Maximum Oplog Size ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Use the :method:`db.collection.stats()` :binary:`~bin.mongo` shell +Use the :method:`db.collection.stats()` :mongosh:`mongosh ` method to display the current maximum oplog size, ``maxSize``, in megabytes. For example: @@ -276,7 +276,7 @@ The above command returns: Change the Minimum Oplog Retention Period ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -1. Connect a :binary:`~bin.mongo` shell to the :binary:`~bin.mongod` +1. Connect :mongosh:`mongosh ` to the :binary:`~bin.mongod` replica set member. #. *Optional*. Use the :method:`db.serverStatus()` command to verify diff --git a/source/reference/command/serverStatus.txt b/source/reference/command/serverStatus.txt index 87e9c3bf6d3..e67cfd5ed3e 100644 --- a/source/reference/command/serverStatus.txt +++ b/source/reference/command/serverStatus.txt @@ -47,7 +47,7 @@ For example: db.runCommand({ serverStatus: 1}).metrics.commands db.runCommand({ serverStatus: 1}).metrics.commands.update -The :binary:`~bin.mongo` shell provides the :method:`db.serverStatus()` +:mongosh:`mongosh ` provides the :method:`db.serverStatus()` wrapper for the :dbcommand:`serverStatus` command. .. seealso:: diff --git a/source/reference/command/setFreeMonitoring.txt b/source/reference/command/setFreeMonitoring.txt index 5b34e2728d2..1359e97b851 100644 --- a/source/reference/command/setFreeMonitoring.txt +++ b/source/reference/command/setFreeMonitoring.txt @@ -41,7 +41,7 @@ setFreeMonitoring explicitly disabled. That is, you do not need to re-enable each time you start the server. - The :binary:`~bin.mongo` shell provides the following helper methods + :mongosh:`mongosh ` provides the following helper methods for :dbcommand:`setFreeMonitoring`: - :method:`db.enableFreeMonitoring()` diff --git a/source/reference/command/shutdown.txt b/source/reference/command/shutdown.txt index f0b6b0e583c..bb4820a05d4 100644 --- a/source/reference/command/shutdown.txt +++ b/source/reference/command/shutdown.txt @@ -93,8 +93,8 @@ See :ref:`cmd-shutdown-access-control` for more information. For a :binary:`~bin.mongod` started *without* :ref:`authentication`, you must run :dbcommand:`shutdown` from a client connected to the -localhost interface. For example, run a :binary:`~bin.mongo` with -the :option:`--host "127.0.0.1" ` option on the +localhost interface. For example, run :mongosh:`mongosh ` with +the :option:`--host "127.0.0.1" ` option on the same host machine as the :binary:`~bin.mongod`. .. _cmd-shutdown-replica-set: diff --git a/source/reference/command/splitChunk.txt b/source/reference/command/splitChunk.txt index c432e7ceed0..f02507037a1 100644 --- a/source/reference/command/splitChunk.txt +++ b/source/reference/command/splitChunk.txt @@ -17,7 +17,7 @@ Definition An internal administrative command. To split chunks, use the :method:`sh.splitFind()` and :method:`sh.splitAt()` functions - in the :binary:`~bin.mongo` shell. + in :mongosh:`mongosh `. .. include:: /includes/warning-splitting-chunks.rst diff --git a/source/reference/command/top.txt b/source/reference/command/top.txt index f1c4383933b..8446942c562 100644 --- a/source/reference/command/top.txt +++ b/source/reference/command/top.txt @@ -45,7 +45,7 @@ top Example ------- -At the :binary:`~bin.mongo` shell prompt, use :dbcommand:`top` with the +At :mongosh:`mongosh ` prompt, use :dbcommand:`top` with the following invocation: .. code-block:: javascript diff --git a/source/reference/command/update.txt b/source/reference/command/update.txt index 615405f15bc..439013a736e 100644 --- a/source/reference/command/update.txt +++ b/source/reference/command/update.txt @@ -22,7 +22,7 @@ Definition statements. The update methods provided by the MongoDB drivers use this command internally. - The :binary:`~bin.mongo` shell provides the following helper methods: + :mongosh:`mongosh ` provides the following helper methods: - :method:`db.collection.updateOne()` diff --git a/source/reference/command/updateZoneKeyRange.txt b/source/reference/command/updateZoneKeyRange.txt index 6b34e4ecd1d..268414b7113 100644 --- a/source/reference/command/updateZoneKeyRange.txt +++ b/source/reference/command/updateZoneKeyRange.txt @@ -109,7 +109,7 @@ Definition Only issue :dbcommand:`updateZoneKeyRange` when connected to a :binary:`~bin.mongos` instance. - The :binary:`~bin.mongo` shell provides two helper methods: + :mongosh:`mongosh ` provides two helper methods: - :method:`sh.updateZoneKeyRange()` for adding a range of shard key values to a zone. diff --git a/source/reference/command/usersInfo.txt b/source/reference/command/usersInfo.txt index 38015fb1ada..70b38352f41 100644 --- a/source/reference/command/usersInfo.txt +++ b/source/reference/command/usersInfo.txt @@ -127,7 +127,7 @@ requested information: - Returns information about the users in the database where the command is run. - The :binary:`~bin.mongo` shell provides the + :mongosh:`mongosh ` provides the :method:`db.getUsers()` helper for this invocation of the command. * - ``{ usersInfo: }`` @@ -135,7 +135,7 @@ requested information: - Return information about the a specific user that exists in the database where the command is run. - The :binary:`~bin.mongo` shell provides the + :mongosh:`mongosh ` provides the :method:`db.getUser()` helper for this invocation of the command. * - ``{ usersInfo: { user: , db: } }`` diff --git a/source/reference/command/validate.txt b/source/reference/command/validate.txt index bc0c99fe4d5..4194ab8519a 100644 --- a/source/reference/command/validate.txt +++ b/source/reference/command/validate.txt @@ -41,7 +41,7 @@ The command has the following syntax: repair: // Optional, added in MongoDB 5.0 } ) -The :binary:`~bin.mongo` shell also provides a wrapper +:mongosh:`mongosh ` also provides a wrapper :method:`db.collection.validate()`. Command Fields diff --git a/source/reference/config-database.txt b/source/reference/config-database.txt index 1aecc18c631..c8a320023bb 100644 --- a/source/reference/config-database.txt +++ b/source/reference/config-database.txt @@ -45,7 +45,7 @@ Collections to Support Sharded Cluster Operations list on the sharding-internals page. To access the ``config`` database and view the list of collections that -support sharding operations, connect a :binary:`~bin.mongo` shell to a +support sharding operations, connect :mongosh:`mongosh ` to a :binary:`~bin.mongos` instance in a sharded cluster and issue the following: .. code-block:: javascript @@ -492,7 +492,7 @@ replica sets and sharded clusters. Do not manually modify or drop these collections. To access these collections for a :binary:`~bin.mongod` or -:binary:`~bin.mongos` instance, connect :binary:`~bin.mongo` shell to the +:binary:`~bin.mongos` instance, connect :mongosh:`mongosh ` to the instance. .. data:: config.system.sessions diff --git a/source/reference/configuration-options.txt b/source/reference/configuration-options.txt index 9e64eb7b597..240ec5e8730 100644 --- a/source/reference/configuration-options.txt +++ b/source/reference/configuration-options.txt @@ -2176,7 +2176,7 @@ Core Options - other members of the deployment if the instance is part of a replica set or a sharded cluster - - a :binary:`~bin.mongo` shell + - :mongosh:`mongosh ` - drivers that support the ``OP_COMPRESSED`` message format. @@ -2799,9 +2799,9 @@ Key Management Configuration Options and Kerberos authentication. The SASL hostname overrides the hostname only for the configuration of SASL and Kerberos. - For :binary:`~bin.mongo` shell and other MongoDB tools to connect to + For :mongosh:`mongosh ` and other MongoDB tools to connect to the new :setting:`~security.sasl.hostName`, see the - ``gssapiHostName`` option in the :binary:`~bin.mongo` shell and other + ``gssapiHostName`` option in :mongosh:`mongosh ` and other tools. @@ -2822,12 +2822,12 @@ Key Management Configuration Options :dbcommand:`setParameter` can not change this setting. This option is available only in MongoDB Enterprise. - + .. important:: Ensure that your driver supports alternate service names. - For :binary:`~bin.mongo` shell and other MongoDB tools to connect to the - new :setting:`~security.sasl.serviceName`, see the + For :mongosh:`mongosh ` and other MongoDB tools to + connect to the new :setting:`~security.sasl.serviceName`, see the ``gssapiServiceName`` option. diff --git a/source/reference/connection-string.txt b/source/reference/connection-string.txt index 34fedec001e..4c8b31d911b 100644 --- a/source/reference/connection-string.txt +++ b/source/reference/connection-string.txt @@ -214,7 +214,7 @@ reconfiguring clients. In order to leverage the DNS seed list, use a connection string prefix of ``mongodb+srv`` rather than the standard ``mongodb``. The ``+srv`` indicates to the client that the hostname that follows corresponds to a -DNS SRV record. The driver or :binary:`~bin.mongo` shell will then +DNS SRV record. The driver or :mongosh:`mongosh ` will then query the DNS for the record to determine which hosts are running the :binary:`~bin.mongod` instances. @@ -314,7 +314,7 @@ string in the standard format would be: .. see:: :ref:`example-connect-mongo-using-srv` provides an example of - connecting the :binary:`~bin.mongo` shell to a replica set using + connecting :mongosh:`mongosh ` to a replica set using the DNS Seed list Connection Format. @@ -329,11 +329,12 @@ Connection options are pairs in the following form: ``name=value``. - The option ``name`` is case insensitive when using a driver. -- The option ``name`` is case insensitive when using a version 4.2 or - later :binary:`~bin.mongo` shell. +- The option ``name`` is case insensitive when using + :mongosh:`mongosh `, or the version 4.2 or later legacy + :binary:`~bin.mongo` shell. - The option ``name`` is case sensitive when using a version 4.0 and - earlier :binary:`~bin.mongo` shell. + earlier legacy :binary:`~bin.mongo` shell. - The ``value`` is always case sensitive. @@ -426,7 +427,7 @@ Alternatively, you can also use the equivalent :urioption:`ssl=true If the :binary:`mongo` shell specifies additional :ref:`tls/ssl ` options from the - command-line, use the :option:`--tls ` + command-line, use the :option:`--tls ` command-line option instead. .. versionadded:: 4.2 @@ -448,7 +449,7 @@ Alternatively, you can also use the equivalent :urioption:`ssl=true If the :binary:`mongo` shell specifies additional :ref:`tls/ssl ` options from the - command-line, use the :option:`--ssl ` + command-line, use the :option:`--ssl ` command-line option instead. * - .. urioption:: tlsCertificateKeyFile @@ -617,8 +618,8 @@ Compression Options If the parties do not share at least one common compressor, messages between the parties are uncompressed. - Starting in MongoDB 4.0.5 (and MongoDB 3.6.10), the - :binary:`~bin.mongo` shell supports the uri connection string + Starting in MongoDB 4.0.5 (and MongoDB 3.6.10), + :mongosh:`mongosh ` supports the uri connection string option :urioption:`compressors`. * - .. urioption:: zlibCompressionLevel @@ -650,7 +651,7 @@ Compression Options - ``9`` providing the best compression but at the slowest speed. - Not supported by the :binary:`~bin.mongo` shell. + Not supported by :mongosh:`mongosh `. .. _connection-pool-options: @@ -722,7 +723,7 @@ supported by the: - MongoDB drivers -- :binary:`~bin.mongo` shell +- :mongosh:`mongosh ` - :binary:`~bin.mongofiles` @@ -822,8 +823,8 @@ The following connection string to a replica set specifies - :readconcern:`linearizable <"linearizable">` - :readconcern:`available <"available">` - This connection string option is not available for the - :binary:`~bin.mongo` shell. Specify the read concern as an + This connection string option is not available for + :mongosh:`mongosh `. Specify the read concern as an :ref:`option to the specific operation `. @@ -1053,7 +1054,7 @@ credentials are authenticated against the ``admin`` database. session token are defined on your platform using their respective `AWS IAM environment variables `__ - the :binary:`~bin.mongo` shell will use these environment + :mongosh:`mongosh ` will use these environment variable values to authenticate; you do not need to specify them in the connection string. @@ -1214,8 +1215,8 @@ Miscellaneous Configuration - the :data:`system.profile.appName` field in the :doc:`database profiler ` output. - If you do not specify a custom app name, the :binary:`~bin.mongo` - shell uses the default "``MongoDB Shell``". + If you do not specify a custom app name, :mongosh:`mongosh ` + uses the default "``MongoDB Shell``". .. versionadded:: 4.0 @@ -1232,7 +1233,7 @@ Miscellaneous Configuration - ``false``. Disables retryable reads for the connection. - The :binary:`~bin.mongo` shell does not support retryable reads. + :mongosh:`mongosh ` does not support retryable reads. .. versionadded:: 4.2 @@ -1446,7 +1447,7 @@ as well, provide it with the ``AWS_SESSION_TOKEN`` You may also set these credentials on your platform using standard `AWS IAM environment variables `__. -The :binary:`~bin.mongo` shell checks for the following environment +:mongosh:`mongosh ` checks for the following environment variables when you use the ``MONGODB-AWS`` :urioption:`authentication mechanism `: diff --git a/source/reference/glossary.txt b/source/reference/glossary.txt index bc3265aef46..691c543b524 100644 --- a/source/reference/glossary.txt +++ b/source/reference/glossary.txt @@ -431,7 +431,7 @@ Glossary support the number of hosts on the contemporary Internet. ISODate - The international date format used by :binary:`~bin.mongo` + The international date format used by :mongosh:`mongosh ` to display dates. The format is: ``YYYY-MM-DD HH:MM.SS.millis``. interrupt point @@ -730,8 +730,8 @@ Glossary query A read request. MongoDB uses a :term:`JSON`-like query language that includes a variety of :term:`query operators ` with - names that begin with a ``$`` character. In the :binary:`~bin.mongo` - shell, you can issue queries using the + names that begin with a ``$`` character. In + :mongosh:`mongosh `, you can issue queries using the :method:`db.collection.find()` and :method:`db.collection.findOne()` methods. See :ref:`read-operations-queries`. @@ -838,8 +838,8 @@ Glossary to fulfill a query. See :doc:`/indexes`. seed list - A seed list is used by drivers and clients (like the - :binary:`~bin.mongo` shell) for initial discovery of the replica + A seed list is used by drivers and clients (like + :mongosh:`mongosh `) for initial discovery of the replica set configuration. Seed lists can be provided as a list of ``host:port`` pairs (see :ref:`connections-standard-connection-string-format` or via DNS entries (see :ref:`connections-dns-seedlist`). diff --git a/source/reference/limits.txt b/source/reference/limits.txt index ed0b2a2371d..c77b194e360 100644 --- a/source/reference/limits.txt +++ b/source/reference/limits.txt @@ -80,8 +80,8 @@ Naming Restrictions If your collection name includes special characters, such as the underscore character, or begins with numbers, then to access the - collection use the :method:`db.getCollection()` method in the - :binary:`~bin.mongo` shell or a :api:`similar method for your driver <>`. + collection use the :method:`db.getCollection()` method in + :mongosh:`mongosh ` or a :api:`similar method for your driver <>`. Namespace Length: @@ -419,9 +419,8 @@ Operations The limit raises from ``1,000`` to ``100,000`` writes. This limit also applies to legacy ``OP_INSERT`` messages. - The :method:`Bulk()` operations in the - :binary:`~bin.mongo` shell and comparable methods in the drivers do not - have this limit. + The :method:`Bulk()` operations in :mongosh:`mongosh ` and + comparable methods in the drivers do not have this limit. .. limit:: Views diff --git a/source/reference/local-database.txt b/source/reference/local-database.txt index fd2f81764ac..f0ddf5975d8 100644 --- a/source/reference/local-database.txt +++ b/source/reference/local-database.txt @@ -111,8 +111,8 @@ Collections on Replica Set Members :data:`local.system.replset` holds the replica set's configuration object as its single document. To view the object's configuration - information, issue :method:`rs.conf()` from the :binary:`~bin.mongo` - shell. You can also query this collection directly. + information, issue :method:`rs.conf()` from :mongosh:`mongosh `. + You can also query this collection directly. .. data:: local.oplog.rs diff --git a/source/reference/log-messages.txt b/source/reference/log-messages.txt index fb1f952923f..9e321780925 100644 --- a/source/reference/log-messages.txt +++ b/source/reference/log-messages.txt @@ -635,7 +635,7 @@ Client Data ~~~~~~~~~~~ `MongoDB drivers `_ and -client applications (including the :binary:`~bin.mongo` shell) have the +client applications (including :mongosh:`mongosh `) have the ability to send identifying information at the time of connection to the server. After the connection is established, the client does not send the identifying information again unless the connection is dropped @@ -645,7 +645,7 @@ This identifying information is contained in the **attributes** field of the log entry. The exact information included varies by client. Below is a sample log message containing the client data document as -transmitted from a :binary:`~bin.mongo` shell connection. The client +transmitted from a :mongosh:`mongosh ` connection. The client data is contained in the ``doc`` object in the **attributes** field: .. code-block:: javascript @@ -816,7 +816,7 @@ For example, the following sets the :setting:`default verbosity level } } ) -You would set these values from the :binary:`~bin.mongo` shell. +You would set these values from :mongosh:`mongosh `. ``db.setLogLevel()`` ```````````````````` @@ -832,7 +832,7 @@ parent. For example, the following sets the db.setLogLevel(-1, "query") -You would set this value from the :binary:`~bin.mongo` shell. +You would set this value from :mongosh:`mongosh `. .. [#slow-oplogs] @@ -943,8 +943,8 @@ Analyzing Client Types The following example analyzes the reported :ref:`client data ` of remote `MongoDB driver `__ -connections and client applications, including the :binary:`~bin.mongo` -shell, and prints a total for each unique operating system type that +connections and client applications, including :mongosh:`mongosh `, +and prints a total for each unique operating system type that connected, sorted by frequency: .. code-block:: bash diff --git a/source/reference/method.txt b/source/reference/method.txt index b6ac16b5f29..e0bbecc27d9 100644 --- a/source/reference/method.txt +++ b/source/reference/method.txt @@ -431,7 +431,7 @@ Database * - :method:`db.getCollection()` - - Returns a collection or view object. Used to access collections with names that are not valid in the :binary:`~bin.mongo` shell. + - Returns a collection or view object. Used to access collections with names that are not valid in :mongosh:`mongosh `. * - :method:`db.getCollectionInfos()` @@ -770,7 +770,7 @@ User Management * - :method:`passwordPrompt()` - Prompts for the password as an alternative to specifying passwords - directly in various :binary:`~bin.mongo` shell user + directly in various :mongosh:`mongosh ` user authentication/management methods. @@ -1261,7 +1261,7 @@ Native * - :method:`getHostName()` - - Returns the hostname of the system running the :binary:`~bin.mongo` shell. + - Returns the hostname of the system running :mongosh:`mongosh `. * - :method:`getMemInfo()` @@ -1273,7 +1273,8 @@ Native * - :doc:`/reference/method/isInteractive` - - Returns a boolean indicating whether the :binary:`~bin.mongo` shell is running in interactive or script mode. + - Returns a boolean indicating whether :mongosh:`mongosh ` is + running in interactive or script mode. * - :method:`listFiles()` @@ -1313,15 +1314,15 @@ Native * - :doc:`/reference/method/sleep` - - Suspends the :binary:`~bin.mongo` shell for a given period of time. + - Suspends :mongosh:`mongosh ` for a given period of time. * - :method:`setVerboseShell()` - - Configures the :binary:`~bin.mongo` shell to report operation timing. + - Configures :mongosh:`mongosh ` to report operation timing. * - :doc:`/reference/method/version` - - Returns the current version of the :binary:`~bin.mongo` shell instance. + - Returns the current version of :mongosh:`mongosh ` instance. * - :method:`_isWindows()` diff --git a/source/reference/method/Date.txt b/source/reference/method/Date.txt index 10bbfa8f7c7..3fd83a15632 100644 --- a/source/reference/method/Date.txt +++ b/source/reference/method/Date.txt @@ -15,11 +15,11 @@ Date() Returns a date either as a string or as a :ref:`document-bson-type-date` object. - - ``Date()`` returns the current date as a string in the - :binary:`~bin.mongo` shell. + - ``Date()`` returns the current date as a string in + :mongosh:`mongosh `. - ``new Date()`` returns the current date as a - :ref:`document-bson-type-date` object. The :binary:`~bin.mongo` shell + :ref:`document-bson-type-date` object. :mongosh:`mongosh ` wraps the :ref:`document-bson-type-date` object with the ``ISODate`` helper. The ``ISODate`` is in `UTC `__. @@ -90,7 +90,7 @@ following example: Return Date as ``Date`` Object ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The :binary:`~bin.mongo` shell wrap objects of +:mongosh:`mongosh ` wraps objects of :ref:`document-bson-type-date` type with the ``ISODate`` helper; however, the objects remain of type :ref:`document-bson-type-date`. diff --git a/source/reference/method/Mongo.getDB.txt b/source/reference/method/Mongo.getDB.txt index d480e95b273..25dde330ae3 100644 --- a/source/reference/method/Mongo.getDB.txt +++ b/source/reference/method/Mongo.getDB.txt @@ -16,7 +16,7 @@ Description .. method:: Mongo.getDB() Provides access to database objects from - the :binary:`~bin.mongo` shell or from a JavaScript file. + :mongosh:`mongosh ` or from a JavaScript file. The :method:`Mongo.getDB()` method has the following parameter: diff --git a/source/reference/method/Mongo.setCausalConsistency.txt b/source/reference/method/Mongo.setCausalConsistency.txt index 4207db65937..31b452ae144 100644 --- a/source/reference/method/Mongo.setCausalConsistency.txt +++ b/source/reference/method/Mongo.setCausalConsistency.txt @@ -50,9 +50,9 @@ Definition Example ------- -The following :binary:`~bin.mongo` shell operation enables causal +The following :mongosh:`mongosh ` operation enables causal consistency on the :method:`Mongo` connection object associated with -the :binary:`~bin.mongo` shell's global ``db`` variable: +:mongosh:`mongosh `'s global ``db`` variable: .. code-block:: javascript diff --git a/source/reference/method/Mongo.startSession.txt b/source/reference/method/Mongo.startSession.txt index d4d06c2fc10..07e7d809302 100644 --- a/source/reference/method/Mongo.startSession.txt +++ b/source/reference/method/Mongo.startSession.txt @@ -17,9 +17,9 @@ Definition .. versionadded:: 3.6 - Starts a :ref:`session ` for the connection. The - :binary:`~bin.mongo` shell assigns the session id to - commands associated with the session. + Starts a :ref:`session ` for the connection. + :mongosh:`mongosh ` assigns the session id to commands associated + with the session. The :method:`~Mongo.startSession()` method can take a document with session options. The options available are: @@ -77,8 +77,8 @@ Definition - Boolean. Enables or disables the ability to retry writes upon encountering transient network errors. - If you start the :binary:`~bin.mongo` shell with the - :option:`--retryWrites ` option, ``retryWrites`` is enabled by + If you start :mongosh:`mongosh ` with the + :option:`--retryWrites ` option, ``retryWrites`` is enabled by default for :method:`Mongo.startSession()`. After starting a session, you cannot modify its @@ -97,7 +97,7 @@ Examples The following starts a session with causal consistency and retryable writes enabled on the :method:`Mongo` connection object associated with -the :binary:`~bin.mongo` shell's global ``db`` variable: +:mongosh:`mongosh `'s global ``db`` variable: .. code-block:: javascript diff --git a/source/reference/method/Mongo.txt b/source/reference/method/Mongo.txt index 9d43f4bb85e..25518ae1901 100644 --- a/source/reference/method/Mongo.txt +++ b/source/reference/method/Mongo.txt @@ -17,8 +17,8 @@ Description .. method:: Mongo(host, ClientSideFieldLevelEncryptionOptions) - JavaScript constructor to instantiate a database connection from the - :binary:`~bin.mongo` shell or from a JavaScript file. + JavaScript constructor to instantiate a database connection from + :mongosh:`mongosh ` or from a JavaScript file. The :method:`Mongo()` method has the following parameters: @@ -80,7 +80,7 @@ If the database connection has an existing client-side field level encryption configuration, specifying ``ClientSideFieldLevelEncryptionOptions`` overrides that configuration. -For example, starting the :binary:`~bin.mongo` shell +For example, starting :mongosh:`mongosh ` with client-side field level encryption :ref:`command-line options ` enables client-side encryption for that connection. New database connections @@ -165,8 +165,8 @@ following parameters: If possible, consider defining the credentials provided in ``kmsProviders`` as environment variables, and then passing them - to the :binary:`~bin.mongo` shell using the :option:`--eval - ` option. This minimizes the chances of credentials + to :mongosh:`mongosh ` using the :option:`--eval + ` option. This minimizes the chances of credentials leaking into logs. See :ref:`field-level-encryption-data-key-create` for examples of this approach for each supported KMS. @@ -260,8 +260,8 @@ Example Connect to a MongoDB Cluster ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The following operation creates a new connection object from the -:binary:`~bin.mongo` shell: +The following operation creates a new connection object from within a +:mongosh:`mongosh ` session: .. code-block:: javascript @@ -284,7 +284,7 @@ Configuring client-side field level encryption for a :ref:`locally managed key ` requires specifying a base64-encoded 96-byte string with no line breaks. The following operation generates a key that meets the stated requirements and loads -it into the :binary:`~bin.mongo` shell: +it into :mongosh:`mongosh `: .. code-block:: bash :emphasize-lines: 1 @@ -293,8 +293,8 @@ it into the :binary:`~bin.mongo` shell: mongo --nodb --shell --eval "var TEST_LOCAL_KEY='$TEST_LOCAL_KEY'" -The following operation creates a new connection object from the -:binary:`~bin.mongo` shell. The +The following operation creates a new connection object from within a +:mongosh:`mongosh ` session. The :ref:`ClientSideFieldLevelEncryptionOptions` option specifies the required options for enabling client-side field level encryption using a locally managed key: @@ -345,7 +345,7 @@ Configuring client-side field level encryption for a :ref:`locally managed key ` requires specifying a base64-encoded 96-byte string with no line breaks. The following operation generates a key that meets the stated requirements and loads -it into the :binary:`~bin.mongo` shell: +it into :mongosh:`mongosh `: .. code-block:: bash :emphasize-lines: 1 @@ -354,8 +354,8 @@ it into the :binary:`~bin.mongo` shell: mongo --nodb --shell --eval "var TEST_LOCAL_KEY='$TEST_LOCAL_KEY'" -The following operation creates a new connection object from the -:binary:`~bin.mongo` shell. The +The following operation creates a new connection object from within a +:mongosh:`mongosh ` session. The :ref:`ClientSideFieldLevelEncryptionOptions` option specifies the required options for enabling :ref:`automatic client-side encryption ` on the ``hr.employees`` collection: diff --git a/source/reference/method/Mongo.watch.txt b/source/reference/method/Mongo.watch.txt index 9513ee6b8dc..4dffbbdbf8d 100644 --- a/source/reference/method/Mongo.watch.txt +++ b/source/reference/method/Mongo.watch.txt @@ -271,7 +271,7 @@ privileges. Example ------- -The following operation in the :binary:`~bin.mongo` shell opens a +The following operation in :mongosh:`mongosh ` opens a change stream cursor on a replica set. The returned cursor reports on data changes to all the non-``system`` collections across all databases except for the ``admin``, ``local``, and the ``config`` databases. diff --git a/source/reference/method/ObjectId.toString.txt b/source/reference/method/ObjectId.toString.txt index 02f5db2cd15..1f55b3fba7d 100644 --- a/source/reference/method/ObjectId.toString.txt +++ b/source/reference/method/ObjectId.toString.txt @@ -19,7 +19,7 @@ Example ------- The following example calls the :method:`~ObjectId.toString()` method -on an :method:`ObjectId()` instance in the :binary:`~bin.mongo` shell: +on an :method:`ObjectId()` instance in :mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/reference/method/Session.txt b/source/reference/method/Session.txt index 15152f323d8..91a7168db0a 100644 --- a/source/reference/method/Session.txt +++ b/source/reference/method/Session.txt @@ -17,10 +17,10 @@ Definition .. versionadded:: 3.6 - The Session object for the connection in the :binary:`~bin.mongo` shell. - To instantiate a session for the connection in the :binary:`~bin.mongo` - shell, see :method:`Mongo.startSession()`. For more information on - sessions, see :ref:`sessions`. + The Session object for the connection in :mongosh:`mongosh `. + To instantiate a session for the connection in + :mongosh:`mongosh `, see :method:`Mongo.startSession()`. For more + information on sessions, see :ref:`sessions`. .. list-table:: @@ -29,7 +29,7 @@ Definition * - .. method:: Session.getDatabase() - - Access the specified database from the session in the :binary:`~bin.mongo` shell. + - Access the specified database from the session in :mongosh:`mongosh `. * - .. method:: Session.advanceClusterTime({ clusterTime: , signature: { hash: , keyId: } }) @@ -82,7 +82,7 @@ Example ------- The following example starts a session on the :method:`Mongo` -connection object associated with the :binary:`~bin.mongo` shell's global +connection object associated with :mongosh:`mongosh `'s global ``db`` variable, and then uses the :method:`Session.getDatabase()` method to retrieve the database object associated with the session. diff --git a/source/reference/method/SessionOptions.txt b/source/reference/method/SessionOptions.txt index 4dcf6aedd63..1dae933d480 100644 --- a/source/reference/method/SessionOptions.txt +++ b/source/reference/method/SessionOptions.txt @@ -17,8 +17,8 @@ Definition .. versionadded:: 3.6 - The options for a :method:`session ` in the - :binary:`~bin.mongo` shell. To access the :method:`SessionOptions` + The options for a :method:`session ` in + :mongosh:`mongosh `. To access the :method:`SessionOptions` object, use the :method:`Session.getOptions()` method. The session options available are: @@ -44,7 +44,7 @@ Definition - Document. Specifies the :ref:`read concern `. - In the :binary:`~bin.mongo` shell, you can set the option when + In :mongosh:`mongosh `, you can set the option when you run :method:`Mongo.startSession()`. You can also access the ``readConcern`` option via the following methods: @@ -56,7 +56,7 @@ Definition - Document. Specifies the :ref:`read preference `. - In the :binary:`~bin.mongo` shell, you can set the option + In :mongosh:`mongosh `, you can set the option when you run :method:`Mongo.startSession()`. You can also access the ``readPreference`` option via the following methods: @@ -71,8 +71,8 @@ Definition encountering transient network errors, such as during failovers. - To enable retry writes, start the :binary:`~bin.mongo` shell - with the :option:`--retryWrites ` option. + To enable retry writes, start :mongosh:`mongosh ` + with the :option:`--retryWrites ` option. You can view whether ``retryWrites`` is enabled for a session via the following method: @@ -83,7 +83,7 @@ Definition - Document. Specifies the :ref:`write concern `. - In the :binary:`~bin.mongo` shell, you can set the options + In :mongosh:`mongosh `, you can set the options when you run :method:`Mongo.startSession()`. You can also access the ``writeConcern`` option via the following methods: diff --git a/source/reference/method/UUID.txt b/source/reference/method/UUID.txt index 13febd71c03..015cfc8f46b 100644 --- a/source/reference/method/UUID.txt +++ b/source/reference/method/UUID.txt @@ -39,7 +39,7 @@ Generates a BSON :abbr:`UUID (Universally unique identifier)` object. .. versionchanged:: 3.6 - In earlier versions of the :binary:`~bin.mongo` shell, + In earlier versions of :mongosh:`mongosh `, :method:`UUID` required a hexadecimal string argument. See the :v3.4:`3.4 manual `. @@ -87,5 +87,5 @@ This command outputs a random UUID in the following form: .. versionchanged:: 3.6 - In earlier versions of the :binary:`~bin.mongo` shell, + In earlier versions of :mongosh:`mongosh `, :method:`UUID` required a hexadecimal string argument. diff --git a/source/reference/method/WriteResult.hasWriteConcernError.txt b/source/reference/method/WriteResult.hasWriteConcernError.txt index f7f53fcb99a..ad07eb9f4e3 100644 --- a/source/reference/method/WriteResult.hasWriteConcernError.txt +++ b/source/reference/method/WriteResult.hasWriteConcernError.txt @@ -15,7 +15,7 @@ Definition .. method:: WriteResult.hasWriteConcernError() - Returns ``true`` if the result of a :binary:`~bin.mongo` shell write + Returns ``true`` if the result of a :mongosh:`mongosh ` write method has :data:`WriteResult.writeConcernError`. Otherwise, the method returns ``false``. diff --git a/source/reference/method/WriteResult.hasWriteError.txt b/source/reference/method/WriteResult.hasWriteError.txt index 60187106ad0..5dcce522597 100644 --- a/source/reference/method/WriteResult.hasWriteError.txt +++ b/source/reference/method/WriteResult.hasWriteError.txt @@ -15,7 +15,7 @@ Definition .. method:: WriteResult.hasWriteError() - Returns ``true`` if the result of a :binary:`~bin.mongo` shell write + Returns ``true`` if the result of a :mongosh:`mongosh ` write method has :data:`WriteResult.writeError`. Otherwise, the method returns ``false``. diff --git a/source/reference/method/WriteResult.txt b/source/reference/method/WriteResult.txt index b6ab609378c..4083872baf6 100644 --- a/source/reference/method/WriteResult.txt +++ b/source/reference/method/WriteResult.txt @@ -15,8 +15,8 @@ Definition .. method:: WriteResult() - A wrapper that contains the result status of the :binary:`~bin.mongo` - shell write methods. + A wrapper that contains the result status of :mongosh:`mongosh ` + write methods. .. see:: diff --git a/source/reference/method/cd.txt b/source/reference/method/cd.txt index bfb7fa989b5..2ec303f4995 100644 --- a/source/reference/method/cd.txt +++ b/source/reference/method/cd.txt @@ -30,11 +30,8 @@ Definition - string - - A path on the file system local to the :binary:`~bin.mongo` shell context. - - - + - A path on the file system local to :mongosh:`mongosh ` context. - :method:`cd()` changes the directory context of the - :binary:`~bin.mongo` shell and has no effect on the MongoDB server. + :method:`cd()` changes the directory context of + :mongosh:`mongosh ` and has no effect on the MongoDB server. diff --git a/source/reference/method/cursor.addOption.txt b/source/reference/method/cursor.addOption.txt index 853cbc0d08f..5f438beaf2e 100644 --- a/source/reference/method/cursor.addOption.txt +++ b/source/reference/method/cursor.addOption.txt @@ -41,7 +41,7 @@ Definition - flag - - ``OP_QUERY`` wire protocol flag. For the :binary:`~bin.mongo` shell, + - ``OP_QUERY`` wire protocol flag. For :mongosh:`mongosh `, you can use the cursor flags listed below. For the driver-specific list, see your :driver:`driver documentation `. @@ -54,7 +54,7 @@ Definition Flags ----- -The :binary:`~bin.mongo` shell provides several additional cursor flags to +:mongosh:`mongosh ` provides several additional cursor flags to modify the behavior of the cursor. .. list-table:: diff --git a/source/reference/method/cursor.batchSize.txt b/source/reference/method/cursor.batchSize.txt index 93547786119..947e16b0f3c 100644 --- a/source/reference/method/cursor.batchSize.txt +++ b/source/reference/method/cursor.batchSize.txt @@ -22,9 +22,8 @@ Definition Specifies the number of documents to return in each batch of the response from the MongoDB instance. In most cases, modifying the batch size will - not affect the user or the application, as the - :binary:`~bin.mongo` shell and most :driver:`drivers - ` return results as if MongoDB returned a + not affect the user or the application, as :mongosh:`mongosh ` and + most :driver:`drivers ` return results as if MongoDB returned a single batch. The :method:`~cursor.batchSize()` method takes the @@ -63,7 +62,7 @@ Example The following example sets the batch size for the results of a query (i.e. :method:`~db.collection.find()`) to ``10``. The :method:`~cursor.batchSize()` method does not change the -output in the :binary:`~bin.mongo` shell, which, by default, iterates over the +output in :mongosh:`mongosh `, which, by default, iterates over the first 20 documents. .. code-block:: javascript diff --git a/source/reference/method/db.auth.txt b/source/reference/method/db.auth.txt index 0e0b8ffcc02..0d773d6b9b3 100644 --- a/source/reference/method/db.auth.txt +++ b/source/reference/method/db.auth.txt @@ -202,7 +202,7 @@ Example Authenticate after Connecting to the Shell ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -To authenticate after connecting the :binary:`~bin.mongo` shell, issue +To authenticate after connecting :mongosh:`mongosh `, issue :method:`db.auth()` in the user's :ref:`authentication database `: @@ -233,13 +233,13 @@ method to: Authenticate when Connecting to the Shell ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Alternatively, you can use the :binary:`~bin.mongo` shell's -command-line options :option:`--username `, -:option:`--password `, -:option:`--authenticationDatabase `, +Alternatively, you can use :mongosh:`mongosh `'s +command-line options :option:`--username `, +:option:`--password `, +:option:`--authenticationDatabase `, and :option:`--authenticationMechanism ` to specify authentication credentials when -connecting the :binary:`~bin.mongo` shell: +connecting :mongosh:`mongosh `: .. code-block:: bash diff --git a/source/reference/method/db.changeUserPassword.txt b/source/reference/method/db.changeUserPassword.txt index 9ed533ea5d3..03e435b6930 100644 --- a/source/reference/method/db.changeUserPassword.txt +++ b/source/reference/method/db.changeUserPassword.txt @@ -93,7 +93,7 @@ The following operation changes the password of the user named use products db.changeUserPassword("accountUser", passwordPrompt()) -When prompted in the :binary:`~bin.mongo` shell for the password, enter +When prompted in :mongosh:`mongosh ` for the password, enter the new password. You can also pass the new password directly to diff --git a/source/reference/method/db.collection.aggregate.txt b/source/reference/method/db.collection.aggregate.txt index df457b03c65..7348859e5b9 100644 --- a/source/reference/method/db.collection.aggregate.txt +++ b/source/reference/method/db.collection.aggregate.txt @@ -247,12 +247,12 @@ Error Handling Cursor Behavior ~~~~~~~~~~~~~~~ -In the :binary:`~bin.mongo` shell, if the cursor returned from the +In :mongosh:`mongosh `, if the cursor returned from the :method:`db.collection.aggregate()` is not assigned to a variable using -the ``var`` keyword, then the :binary:`~bin.mongo` shell automatically +the ``var`` keyword, then :mongosh:`mongosh ` automatically iterates the cursor up to 20 times. See -:doc:`/tutorial/iterate-a-cursor` for handling cursors in the -:binary:`~bin.mongo` shell. +:doc:`/tutorial/iterate-a-cursor` for handling cursors in +:mongosh:`mongosh `. Cursors returned from aggregation only supports cursor methods that operate on evaluated cursors (i.e. cursors whose first batch has been diff --git a/source/reference/method/db.collection.createIndex.txt b/source/reference/method/db.collection.createIndex.txt index 11af79bd222..aa08fc9d4ee 100644 --- a/source/reference/method/db.collection.createIndex.txt +++ b/source/reference/method/db.collection.createIndex.txt @@ -688,7 +688,7 @@ Hidden Option ` set to ``4.2`` on MongoDB 4.4 binaries. To hide or unhide existing indexes, you can use the following -:binary:`~bin.mongo` shell methods: +:mongosh:`mongosh ` methods: - :method:`db.collection.hideIndex()` diff --git a/source/reference/method/db.collection.createIndexes.txt b/source/reference/method/db.collection.createIndexes.txt index 01a34aff0c6..ed7e512036e 100644 --- a/source/reference/method/db.collection.createIndexes.txt +++ b/source/reference/method/db.collection.createIndexes.txt @@ -695,7 +695,7 @@ Hidden Option ` set to ``4.2`` on MongoDB 4.4 binaries. To hide or unhide existing indexes, you can use the following -:binary:`~bin.mongo` shell methods: +:mongosh:`mongosh ` methods: - :method:`db.collection.hideIndex()` diff --git a/source/reference/method/db.collection.deleteMany.txt b/source/reference/method/db.collection.deleteMany.txt index 35a69b3c567..4088726713d 100644 --- a/source/reference/method/db.collection.deleteMany.txt +++ b/source/reference/method/db.collection.deleteMany.txt @@ -277,7 +277,7 @@ Specify ``hint`` for Delete Operations .. versionadded:: 4.4 -From the :binary:`~bin.mongo` shell, create a ``members`` collection +In :mongosh:`mongosh `, create a ``members`` collection with the following documents: .. code-block:: javascript diff --git a/source/reference/method/db.collection.deleteOne.txt b/source/reference/method/db.collection.deleteOne.txt index 3c21f3d5394..c3af98cf186 100644 --- a/source/reference/method/db.collection.deleteOne.txt +++ b/source/reference/method/db.collection.deleteOne.txt @@ -286,7 +286,7 @@ Specify ``hint`` for Delete Operations .. versionadded:: 4.4 -From the :binary:`~bin.mongo` shell, create a ``members`` collection +In :mongosh:`mongosh `, create a ``members`` collection with the following documents: .. code-block:: javascript diff --git a/source/reference/method/db.collection.explain.txt b/source/reference/method/db.collection.explain.txt index 858fde38a5f..d525afbf011 100644 --- a/source/reference/method/db.collection.explain.txt +++ b/source/reference/method/db.collection.explain.txt @@ -273,8 +273,8 @@ following operation provides information on the { quantity: { $gt: 50 }, category: "apparel" } ).sort( { quantity: -1 } ).hint( { category: 1, quantity: -1 } ) -For a list of query modifiers available, run in the :binary:`~bin.mongo` -shell: +For a list of query modifiers available, run the following in +:mongosh:`mongosh `: .. code-block:: javascript @@ -284,8 +284,8 @@ Iterate the ``explain().find()`` Return Cursor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :method:`db.collection.explain().find() ` -returns a cursor to the explain results. If run interactively in the -:binary:`~bin.mongo` shell, the :binary:`~bin.mongo` shell automatically +returns a cursor to the explain results. If run interactively in +:mongosh:`mongosh `, :mongosh:`mongosh ` automatically iterates the cursor using the ``.next()`` method. For scripts, however, you must explicitly call ``.next()`` (or its alias ``.finish()``) to return the results: diff --git a/source/reference/method/db.collection.find.txt b/source/reference/method/db.collection.find.txt index 578b840a90b..41069e2f480 100644 --- a/source/reference/method/db.collection.find.txt +++ b/source/reference/method/db.collection.find.txt @@ -104,7 +104,7 @@ See :ref:`Projection Examples `. Cursor Handling ~~~~~~~~~~~~~~~ -Executing :method:`db.collection.find()` in the :binary:`~bin.mongo` shell +Executing :method:`db.collection.find()` in :mongosh:`mongosh ` automatically iterates the cursor to display up to the first 20 documents. Type ``it`` to continue iteration. @@ -672,7 +672,7 @@ Iterate the Returned Cursor The :method:`~db.collection.find()` method returns a :ref:`cursor ` to the results. -In the :binary:`~bin.mongo` shell, if the returned cursor is not assigned to a +In :mongosh:`mongosh `, if the returned cursor is not assigned to a variable using the ``var`` keyword, the cursor is automatically iterated to access up to the first 20 documents that match the query. You can set the ``DBQuery.shellBatchSize`` variable to change the number of automatically @@ -737,7 +737,7 @@ to iterate the cursor and access the documents: Modify the Cursor Behavior ~~~~~~~~~~~~~~~~~~~~~~~~~~ -The :binary:`~bin.mongo` shell and the :driver:`drivers +:mongosh:`mongosh ` and the :driver:`drivers ` provide several cursor methods that call on the *cursor* returned by the :method:`~db.collection.find()` method to modify its behavior. diff --git a/source/reference/method/db.collection.latencyStats.txt b/source/reference/method/db.collection.latencyStats.txt index 44c93eb3d0a..d273119dbb7 100644 --- a/source/reference/method/db.collection.latencyStats.txt +++ b/source/reference/method/db.collection.latencyStats.txt @@ -48,8 +48,8 @@ a field ``latencyStats``, containing the following fields: Examples -------- -You can run :method:`~db.collection.latencyStats()` in a :binary:`~bin.mongo` -shell as follows: +You can run :method:`~db.collection.latencyStats()` in +:mongosh:`mongosh ` as follows: .. code-block:: javascript diff --git a/source/reference/method/db.collection.update.txt b/source/reference/method/db.collection.update.txt index 8f6a906d579..2b27fb7dcff 100644 --- a/source/reference/method/db.collection.update.txt +++ b/source/reference/method/db.collection.update.txt @@ -995,7 +995,7 @@ with :method:`~db.collection.update()`. Using ``upsert`` with ``multi`` (Match) ``````````````````````````````````````` - From the :binary:`~bin.mongo` shell, insert the following + From :mongosh:`mongosh `, insert the following documents into a ``books`` collection: .. code-block:: javascript @@ -1296,7 +1296,7 @@ Update Elements Match ``arrayFilters`` Criteria To update all array elements which match a specified criteria, use the :ref:`arrayFilters ` parameter. -From the :binary:`~bin.mongo` shell, create a ``students`` +In :mongosh:`mongosh `, create a ``students`` collection with the following documents: .. code-block:: javascript @@ -1337,7 +1337,7 @@ You can also use the :ref:`arrayFilters ` parameter to update specific document fields within an array of documents. -From the :binary:`~bin.mongo` shell, create a ``students2`` +In :mongosh:`mongosh `, create a ``students2`` collection with the following documents: .. code-block:: javascript @@ -1405,7 +1405,7 @@ Specify ``hint`` for Update Operations .. versionadded:: 4.2 -From the :binary:`~bin.mongo` shell, create a ``members`` +In :mongosh:`mongosh `, create a ``members`` collection with the following documents: .. code-block:: javascript @@ -1504,7 +1504,7 @@ Specify Collation .. include:: /includes/extracts/collation-option.rst -From the :binary:`~bin.mongo` shell, create a collection named +In :mongosh:`mongosh `, create a collection named ``myColl`` with the following documents: .. code-block:: javascript diff --git a/source/reference/method/db.copyDatabase.txt b/source/reference/method/db.copyDatabase.txt index 9d61021122b..d770e97656b 100644 --- a/source/reference/method/db.copyDatabase.txt +++ b/source/reference/method/db.copyDatabase.txt @@ -32,10 +32,9 @@ Definition the current :binary:`~bin.mongod` instance or within the current :binary:`~bin.mongod`. - The :binary:`~bin.mongo` shell method :method:`db.copyDatabase()` + The :mongosh:`mongosh ` helper method :method:`db.copyDatabase()` takes the following arguments: - .. list-table:: :header-rows: 1 :widths: 20 20 80 diff --git a/source/reference/method/db.disableFreeMonitoring.txt b/source/reference/method/db.disableFreeMonitoring.txt index 0349dae8400..319150c9d05 100644 --- a/source/reference/method/db.disableFreeMonitoring.txt +++ b/source/reference/method/db.disableFreeMonitoring.txt @@ -51,8 +51,7 @@ privilege. Example ------- -To disable free monitoring, run the following from the -:binary:`~bin.mongo` shell: +To disable free monitoring, run the following in :mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/reference/method/db.dropDatabase.txt b/source/reference/method/db.dropDatabase.txt index 9a104212890..735eb44b2c7 100644 --- a/source/reference/method/db.dropDatabase.txt +++ b/source/reference/method/db.dropDatabase.txt @@ -114,7 +114,7 @@ collections in the dropped database. Example ------- -The following example in the :binary:`~bin.mongo` shell uses the ``use +The following example in :mongosh:`mongosh ` uses the ``use `` operation to switch the current database to the ``temp`` database and then uses the :method:`db.dropDatabase()` method to drops the ``temp`` database: diff --git a/source/reference/method/db.enableFreeMonitoring.txt b/source/reference/method/db.enableFreeMonitoring.txt index eae41c4bd03..e44998e0f81 100644 --- a/source/reference/method/db.enableFreeMonitoring.txt +++ b/source/reference/method/db.enableFreeMonitoring.txt @@ -73,8 +73,7 @@ privilege. Example ------- -To enable free monitoring, run the following from the -:binary:`~bin.mongo` shell: +To enable free monitoring, run the following in :mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/reference/method/db.getCollection.txt b/source/reference/method/db.getCollection.txt index 1a384706b0b..fd439370993 100644 --- a/source/reference/method/db.getCollection.txt +++ b/source/reference/method/db.getCollection.txt @@ -18,7 +18,7 @@ Definition Returns a :term:`collection` or a :doc:`view ` object that is functionally equivalent to using the ``db.`` syntax. The method is useful for a collection or a view whose name - might interact with the :binary:`~bin.mongo` shell itself, such as names + might interact with :mongosh:`mongosh ` itself, such as names that begin with ``_`` or that match a :doc:`database shell method `. diff --git a/source/reference/method/db.getFreeMonitoringStatus.txt b/source/reference/method/db.getFreeMonitoringStatus.txt index bf6e1e0beea..40e420013e0 100644 --- a/source/reference/method/db.getFreeMonitoringStatus.txt +++ b/source/reference/method/db.getFreeMonitoringStatus.txt @@ -14,7 +14,7 @@ db.getFreeMonitoringStatus Returns information on :doc:`free monitoring ` status. - The :binary:`~bin.mongo` shell helper + :mongosh:`mongosh ` helper :method:`db.getFreeMonitoringStatus()` is a wrapper around the :dbcommand:`getFreeMonitoringStatus` command. diff --git a/source/reference/method/db.getMongo.txt b/source/reference/method/db.getMongo.txt index 1fcdd2467a7..94290ccc930 100644 --- a/source/reference/method/db.getMongo.txt +++ b/source/reference/method/db.getMongo.txt @@ -17,12 +17,12 @@ db.getMongo() :returns: The current database connection. :method:`db.getMongo()` runs when the shell initiates. Use this - command to test that the :binary:`~bin.mongo` shell has a connection to + command to test that :mongosh:`mongosh ` has a connection to the proper database instance. .. note:: - The :binary:`~bin.mongo` shell has a sub-command, + :mongosh:`mongosh ` has a sub-command, ``db.getMongo().setSecondaryOk()`` which is not available in ``mongosh``. Use :method:`Mongo.setReadPref()` instead. diff --git a/source/reference/method/db.getSiblingDB.txt b/source/reference/method/db.getSiblingDB.txt index 0f8d7789be1..4f4ead2fe77 100644 --- a/source/reference/method/db.getSiblingDB.txt +++ b/source/reference/method/db.getSiblingDB.txt @@ -46,7 +46,7 @@ Example You can use :method:`db.getSiblingDB()` as an alternative to the ``use `` helper. This is particularly useful when writing scripts -using the :binary:`~bin.mongo` shell where the ``use`` helper is not +using :mongosh:`mongosh ` where the ``use`` helper is not available. Consider the following sequence of operations: .. code-block:: javascript diff --git a/source/reference/method/db.hostInfo.txt b/source/reference/method/db.hostInfo.txt index 4a9d8730b46..73feb4f95d4 100644 --- a/source/reference/method/db.hostInfo.txt +++ b/source/reference/method/db.hostInfo.txt @@ -16,8 +16,8 @@ db.hostInfo() that the :binary:`~bin.mongod` or :binary:`~bin.mongos` runs on. Some of the returned fields are only included on some platforms. - :method:`db.hostInfo()` provides a helper in the :binary:`~bin.mongo` - shell around the :dbcommand:`hostInfo` The output of + :method:`db.hostInfo()` provides a :mongosh:`mongosh ` helper + method around the :dbcommand:`hostInfo` command. The output of :method:`db.hostInfo()` on a Linux system will resemble the following: diff --git a/source/reference/method/db.shutdownServer.txt b/source/reference/method/db.shutdownServer.txt index 64436dbec23..8be0a05234a 100644 --- a/source/reference/method/db.shutdownServer.txt +++ b/source/reference/method/db.shutdownServer.txt @@ -79,8 +79,8 @@ See :ref:`method-shutdown-access-control` for more information. For a :binary:`~bin.mongod` started *without* :ref:`authentication`, you must run :method:`db.shutdownServer()` from a client connected to the -localhost interface. For example, run a :binary:`~bin.mongo` with the -:option:`--host "127.0.0.1" ` option on the same host +localhost interface. For example, run :mongosh:`mongosh ` with the +:option:`--host "127.0.0.1" ` option on the same host machine as the :binary:`~bin.mongod`. .. _method-shutdown-replica-set: diff --git a/source/reference/method/db.watch.txt b/source/reference/method/db.watch.txt index 1be5c7deeeb..64fd69286ac 100644 --- a/source/reference/method/db.watch.txt +++ b/source/reference/method/db.watch.txt @@ -271,7 +271,7 @@ privileges. Example ------- -The following operation in the :binary:`~bin.mongo` shell opens a +The following operation in :mongosh:`mongosh ` opens a change stream cursor on the ``hr`` database. The returned cursor reports on data changes to all the non-``system`` collections in that database. diff --git a/source/reference/method/getHostName.txt b/source/reference/method/getHostName.txt index fb67247b400..04ee0a1685d 100644 --- a/source/reference/method/getHostName.txt +++ b/source/reference/method/getHostName.txt @@ -12,5 +12,4 @@ getHostName() .. method:: getHostName() - :returns: The hostname of the system running the :binary:`~bin.mongo` - shell process. + :returns: The hostname of the system running :mongosh:`mongosh `. diff --git a/source/reference/method/hostname.txt b/source/reference/method/hostname.txt index a1e9fabfe65..78e207b9b78 100644 --- a/source/reference/method/hostname.txt +++ b/source/reference/method/hostname.txt @@ -12,5 +12,4 @@ hostname() .. method:: hostname() - :returns: The hostname of the system running the :binary:`~bin.mongo` - shell process. + :returns: The hostname of the system running :mongosh:`mongosh `. diff --git a/source/reference/method/isInteractive.txt b/source/reference/method/isInteractive.txt index debeb910d05..75c432c9eb6 100644 --- a/source/reference/method/isInteractive.txt +++ b/source/reference/method/isInteractive.txt @@ -15,7 +15,7 @@ isInteractive() .. versionadded:: 4.2 Returns a boolean value indicating if the current - :binary:`~bin.mongo` shell is running in interactive mode or in + :mongosh:`mongosh ` session is running in interactive mode or in script mode: - ``true`` if in interactive mode @@ -31,8 +31,8 @@ Interactive Mode Issuing Operations inside the Shell ``````````````````````````````````` -Connect a :binary:`~bin.mongo` shell to a deployment. Inside the -:binary:`~bin.mongo` shell, type: +Connect :mongosh:`mongosh ` to a deployment. Inside +:mongosh:`mongosh `, run: .. code-block:: javascript @@ -49,15 +49,15 @@ Create a JavaScript ``testExample.js`` file with the content: print("Is the shell in interactive mode? " + isInteractive() ); -Connect a :binary:`~bin.mongo` shell to a deployment. Inside the -:binary:`~bin.mongo` shell, load the javascript file (see +Connect :mongosh:`mongosh ` to a deployment. Inside +:mongosh:`mongosh `, load the javascript file (see :method:`load()`): .. code-block:: javascript let loadStatus = load("testExample.js"); //You may need to specify the path to the file -The method returns in the :binary:`~bin.mongo` shell: +The method returns the following in :mongosh:`mongosh `: .. code-block:: none @@ -73,9 +73,9 @@ Create a JavaScript ``testExample.js`` file with the content: print("\n\nIs the shell in interactive mode? " + isInteractive() ); -From a terminal/command-line prompt (i.e. not inside the -:binary:`~bin.mongo` shell), specify the javascript file to the -:binary:`~bin.mongo` shell to execute the file: +From a terminal/command-line prompt (i.e. not inside +:mongosh:`mongosh `), specify the javascript file to +:mongosh:`mongosh ` in order to execute the file, as follows: .. code-block:: bash @@ -86,7 +86,7 @@ shell version and various information followed by: .. code-block:: none - MongoDB shell version v4.2.0 + MongoDB shell version v4.4.0 ... diff --git a/source/reference/method/isWindows.txt b/source/reference/method/isWindows.txt index bb4f892b746..a9836f60afe 100644 --- a/source/reference/method/isWindows.txt +++ b/source/reference/method/isWindows.txt @@ -14,6 +14,6 @@ _isWindows() :returns: boolean. - Returns "true" if the :binary:`~bin.mongo` shell is running on a + Returns "true" if :mongosh:`mongosh ` is running on a system that is Windows, or "false" if the shell is running on a Unix or Linux systems. diff --git a/source/reference/method/js-client-side-field-level-encryption.txt b/source/reference/method/js-client-side-field-level-encryption.txt index 32508665d34..13133ca35ec 100644 --- a/source/reference/method/js-client-side-field-level-encryption.txt +++ b/source/reference/method/js-client-side-field-level-encryption.txt @@ -14,7 +14,7 @@ Client-Side Field Level Encryption Methods .. include:: /includes/extracts/csfle-requires-enabling-encryption.rst -The following methods are for the MongoDB :binary:`~bin.mongo` shell +The following methods are for :mongosh:`mongosh ` *only*. For instructions on implementing client-side field level encryption using a MongoDB 4.2+ compatible driver, defer to the driver documentation. See :ref:`field-level-encryption-drivers` for diff --git a/source/reference/method/js-database.txt b/source/reference/method/js-database.txt index 1bf96856824..97af02d5a7d 100644 --- a/source/reference/method/js-database.txt +++ b/source/reference/method/js-database.txt @@ -66,7 +66,7 @@ Database Methods * - :method:`db.getCollection()` - - Returns a collection or view object. Used to access collections with names that are not valid in the :binary:`~bin.mongo` shell. + - Returns a collection or view object. Used to access collections with names that are not valid in :mongosh:`mongosh `. * - :method:`db.getCollectionInfos()` diff --git a/source/reference/method/js-native.txt b/source/reference/method/js-native.txt index 5ee3be54c0c..7d4d0829cb9 100644 --- a/source/reference/method/js-native.txt +++ b/source/reference/method/js-native.txt @@ -34,7 +34,7 @@ Native Methods * - :method:`getHostName()` - - Returns the hostname of the system running the :binary:`~bin.mongo` shell. + - Returns the hostname of the system running :mongosh:`mongosh `. * - :method:`getMemInfo()` @@ -46,7 +46,8 @@ Native Methods * - :doc:`/reference/method/isInteractive` - - Returns a boolean indicating whether the :binary:`~bin.mongo` shell is running in interactive or script mode. + - Returns a boolean indicating whether :mongosh:`mongosh ` is + running in interactive or script mode. * - :method:`listFiles()` @@ -86,15 +87,15 @@ Native Methods * - :doc:`/reference/method/sleep` - - Suspends the :binary:`~bin.mongo` shell for a given period of time. + - Suspends :mongosh:`mongosh ` for a given period of time. * - :method:`setVerboseShell()` - - Configures the :binary:`~bin.mongo` shell to report operation timing. + - Configures :mongosh:`mongosh ` to report operation timing. * - :doc:`/reference/method/version` - - Returns the current version of the :binary:`~bin.mongo` shell instance. + - Returns the current version of :mongosh:`mongosh ` instance. * - :method:`_isWindows()` diff --git a/source/reference/method/js-user-management.txt b/source/reference/method/js-user-management.txt index da2f53e73f7..8dde961f77e 100644 --- a/source/reference/method/js-user-management.txt +++ b/source/reference/method/js-user-management.txt @@ -75,7 +75,7 @@ User Management Methods * - :method:`passwordPrompt()` - Prompts for the password as an alternative to specifying passwords - directly in various :binary:`~bin.mongo` shell user + directly in various :mongosh:`mongosh ` user authentication/management methods. diff --git a/source/reference/method/listFiles.txt b/source/reference/method/listFiles.txt index f9361dbc03e..1ebd3b4184e 100644 --- a/source/reference/method/listFiles.txt +++ b/source/reference/method/listFiles.txt @@ -13,8 +13,8 @@ listFiles() .. method:: listFiles() Returns an array, containing one document per object in the - directory. This function operates in the context of the - :binary:`~bin.mongo` shell. The fields included in the documents are: + directory. This function operates in the context of + :mongosh:`mongosh `. The fields included in the documents are: .. describe:: name diff --git a/source/reference/method/load.txt b/source/reference/method/load.txt index cc48e14593d..ad491f82884 100644 --- a/source/reference/method/load.txt +++ b/source/reference/method/load.txt @@ -46,8 +46,8 @@ Definition :method:`pwd()` method. After executing a file with :method:`load()`, you may reference any - functions or variables defined the file from the :binary:`~bin.mongo` - shell environment. + functions or variables defined the file from within + :mongosh:`mongosh `. Example ------- diff --git a/source/reference/method/md5sumFile.txt b/source/reference/method/md5sumFile.txt index 32f4bb68488..e1afafc172b 100644 --- a/source/reference/method/md5sumFile.txt +++ b/source/reference/method/md5sumFile.txt @@ -41,4 +41,4 @@ Description .. note:: The specified filename must refer to a file located on - the system running the :binary:`~bin.mongo` shell. + the system running :mongosh:`mongosh `. diff --git a/source/reference/method/mkdir.txt b/source/reference/method/mkdir.txt index a13a46dda93..0ef2f5300f7 100644 --- a/source/reference/method/mkdir.txt +++ b/source/reference/method/mkdir.txt @@ -17,8 +17,8 @@ Description Creates a directory at the specified path. This method creates the entire path specified if the enclosing directory or - directories do not already exit. The user running the - :binary:`~bin.mongo` shell must have permission to create directories in + directories do not already exit. The user running + :mongosh:`mongosh ` must have permission to create directories in the specified path. This method is equivalent to :command:`mkdir -p` with BSD or GNU utilities. diff --git a/source/reference/method/passwordPrompt.txt b/source/reference/method/passwordPrompt.txt index bc0b11d6b29..257cd51a33a 100644 --- a/source/reference/method/passwordPrompt.txt +++ b/source/reference/method/passwordPrompt.txt @@ -18,7 +18,7 @@ Definition .. versionadded:: 4.2 - Prompts for the password in the :binary:`~bin.mongo` shell. The + Prompts for the password in :mongosh:`mongosh `. The entered password is not displayed in the shell. Use :method:`passwordPrompt()` in conjunction with methods that accept password as a parameter instead of specifying the password in diff --git a/source/reference/method/rs.add.txt b/source/reference/method/rs.add.txt index 5d05a84bed9..f10abc966ad 100644 --- a/source/reference/method/rs.add.txt +++ b/source/reference/method/rs.add.txt @@ -77,7 +77,7 @@ Definition :method:`rs.add()` provides a wrapper around some of the functionality of the :dbcommand:`replSetReconfig` :term:`database - command` and the corresponding :binary:`~bin.mongo` shell helper + command` and the corresponding :mongosh:`mongosh ` helper :method:`rs.reconfig()`. See the :doc:`/reference/replica-configuration` document for full documentation of all replica set configuration options. @@ -94,8 +94,9 @@ Behavior :method:`rs.add()` can, in some cases, trigger an election for primary which will disconnect the shell (such as adding a new member with -a higher priority than the current primary). In such cases, the :binary:`~bin.mongo` -shell may display an error even if the operation succeeds. +a higher priority than the current primary). In such cases, +:mongosh:`mongosh ` may display an error even if the operation +succeeds. .. warning:: diff --git a/source/reference/method/rs.initiate.txt b/source/reference/method/rs.initiate.txt index 7ed77103ef3..3393b768ff7 100644 --- a/source/reference/method/rs.initiate.txt +++ b/source/reference/method/rs.initiate.txt @@ -77,7 +77,7 @@ members of the replica set and clients can connect. .. include:: /includes/warning-bind-ip-security-considerations.rst -Connect a :binary:`~bin.mongo` shell to one of the :binary:`~bin.mongod` +Connect :mongosh:`mongosh ` to one of the :binary:`~bin.mongod` instances and run :method:`rs.initiate()`. .. note:: diff --git a/source/reference/method/rs.reconfig.txt b/source/reference/method/rs.reconfig.txt index 284fb61989a..b52ac79214d 100644 --- a/source/reference/method/rs.reconfig.txt +++ b/source/reference/method/rs.reconfig.txt @@ -308,8 +308,8 @@ A replica set named ``rs0`` has the following configuration: } The following sequence of operations updates the -:rsconf:`members[n].priority` of the second member. -The operations are issued through a :binary:`~bin.mongo` shell connected to +:rsconf:`members[n].priority` of the second member. The operations are +issued through a :mongosh:`mongosh ` session that is connected to the primary. .. code-block:: javascript diff --git a/source/reference/method/rs.status.txt b/source/reference/method/rs.status.txt index 7c03219be94..00f5482bf9f 100644 --- a/source/reference/method/rs.status.txt +++ b/source/reference/method/rs.status.txt @@ -30,7 +30,7 @@ For an example and details on the output, see :ref:`replSetGetStatus `. - Starting in MongoDB 4.2.1 - If you run :binary:`~bin.mongo` shell helper + If you run the :mongosh:`mongosh ` helper method :method:`rs.status()` (or the :dbcommand:`replSetGetStatus` command) on a member during its :ref:`initial sync ` (i.e. :replstate:`STARTUP2` state), @@ -57,5 +57,5 @@ For an example and details on the output, see :ref:`replSetGetStatus ``initialSync: 1`` on the secondary member to return its initial sync information. - You cannot specify ``initialSync: 1`` in the :binary:`~bin.mongo` - shell helper :method:`rs.status()`. + You cannot specify ``initialSync: 1`` to the + :mongosh:`mongosh ` helper method :method:`rs.status()`. diff --git a/source/reference/method/rs.syncFrom.txt b/source/reference/method/rs.syncFrom.txt index 4e56b023345..8f0265c1e5d 100644 --- a/source/reference/method/rs.syncFrom.txt +++ b/source/reference/method/rs.syncFrom.txt @@ -29,7 +29,7 @@ Behavior Example ------- -To use the :method:`rs.syncFrom()` helper in the :binary:`~bin.mongo` shell: +To use the :method:`rs.syncFrom()` helper in :mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/reference/method/setVerboseShell.txt b/source/reference/method/setVerboseShell.txt index 1e1888d24e2..9820156c4a2 100644 --- a/source/reference/method/setVerboseShell.txt +++ b/source/reference/method/setVerboseShell.txt @@ -12,8 +12,8 @@ setVerboseShell() .. method:: setVerboseShell() - The :method:`setVerboseShell()` method configures the :binary:`~bin.mongo` - shell to print the duration of each operation. + The :method:`setVerboseShell()` method configures + :mongosh:`mongosh ` to print the duration of each operation. :method:`setVerboseShell()` has the form: @@ -30,7 +30,7 @@ Example The following example demonstrates the behavior of the verbose shell: -#. From the :binary:`~bin.mongo` shell, set verbose shell to ``true``: +#. From :mongosh:`mongosh `, set verbose shell to ``true``: .. code-block:: bash @@ -47,8 +47,8 @@ The following example demonstrates the behavior of the verbose shell: ] ); -#. In addition to returning the results of the operation, the - :binary:`~bin.mongo` shell now displays information about the duration of +#. In addition to returning the results of the operation, + :mongosh:`mongosh ` now displays information about the duration of the operation: .. code-block:: bash diff --git a/source/reference/method/sh.balancerCollectionStatus.txt b/source/reference/method/sh.balancerCollectionStatus.txt index 61b45ac6cd0..7df90132ac8 100644 --- a/source/reference/method/sh.balancerCollectionStatus.txt +++ b/source/reference/method/sh.balancerCollectionStatus.txt @@ -23,7 +23,7 @@ Definition of draining shards, zone violation or imbalance of chunks across shards. - The :binary:`~bin.mongo` shell method + The :mongosh:`mongosh ` method :method:`sh.balancerCollectionStatus()` wraps the :dbcommand:`balancerCollectionStatus` command. diff --git a/source/reference/method/sh.disableAutoSplit.txt b/source/reference/method/sh.disableAutoSplit.txt index ed76ba6d28c..757c6621bea 100644 --- a/source/reference/method/sh.disableAutoSplit.txt +++ b/source/reference/method/sh.disableAutoSplit.txt @@ -26,9 +26,9 @@ Description information on chunk splits, see :ref:`sharding-chunk-splits`. You can only run :method:`sh.disableAutoSplit()` from a - :binary:`~bin.mongo` shell connected to a :binary:`~bin.mongos` - instance. :method:`sh.disableAutoSplit()` errors if run on a - :binary:`~bin.mongod` instance. + :mongosh:`mongosh ` session that is connected to a + :binary:`~bin.mongos` instance. :method:`sh.disableAutoSplit()` + errors if run on a :binary:`~bin.mongod` instance. .. note:: diff --git a/source/reference/method/sh.enableAutoSplit.txt b/source/reference/method/sh.enableAutoSplit.txt index cef1a29a6fe..04dd1ca9b57 100644 --- a/source/reference/method/sh.enableAutoSplit.txt +++ b/source/reference/method/sh.enableAutoSplit.txt @@ -24,9 +24,9 @@ Description :data:`config.settings` collection. You can only run :method:`sh.enableAutoSplit()` from a - :binary:`~bin.mongo` shell connected to a :binary:`~bin.mongos` - instance. :method:`sh.enableAutoSplit()` errors if run on a - :binary:`~bin.mongod` instance. + :mongosh:`mongosh ` session that is connected to a + :binary:`~bin.mongos` instance. :method:`sh.enableAutoSplit()` errors + if run on a :binary:`~bin.mongod` instance. .. note:: diff --git a/source/reference/method/sh.enableSharding.txt b/source/reference/method/sh.enableSharding.txt index ef3cb56e159..777c6f25bd8 100644 --- a/source/reference/method/sh.enableSharding.txt +++ b/source/reference/method/sh.enableSharding.txt @@ -17,8 +17,8 @@ Definition Enables sharding on the specified database. Once you enabled sharding for a database, you can use :method:`sh.shardCollection()` - to shard collections in that database. The :binary:`~bin.mongo` - shell method :method:`sh.enableSharding()` wraps the + to shard collections in that database. The :mongosh:`mongosh ` + method :method:`sh.enableSharding()` wraps the :dbcommand:`enableSharding` command. Syntax diff --git a/source/reference/method/sh.shardCollection.txt b/source/reference/method/sh.shardCollection.txt index e7d1c2108b3..4eec673b684 100644 --- a/source/reference/method/sh.shardCollection.txt +++ b/source/reference/method/sh.shardCollection.txt @@ -21,7 +21,7 @@ Definition The shard key determines how MongoDB distributes the collection's documents among the shards. - The :binary:`~bin.mongo` shell method :method:`sh.shardCollection` + The :mongosh:`mongosh ` method :method:`sh.shardCollection` wraps the :dbcommand:`shardCollection` command. :method:`sh.shardCollection()` takes the following diff --git a/source/reference/method/sleep.txt b/source/reference/method/sleep.txt index 20a7525d008..427895f89bd 100644 --- a/source/reference/method/sleep.txt +++ b/source/reference/method/sleep.txt @@ -46,7 +46,7 @@ Consider a low-priority bulk data import script. To avoid impacting other processes, you may suspend the shell after inserting each document, distributing the cost of insertion over a longer period of time. -The following example :binary:`~bin.mongo` script will load a JSON file containing +The following example :mongosh:`mongosh ` script will load a JSON file containing an array of documents, and save one element every 100 milliseconds. .. code-block:: javascript diff --git a/source/reference/method/version.txt b/source/reference/method/version.txt index e20a1f42134..a53f45bb62d 100644 --- a/source/reference/method/version.txt +++ b/source/reference/method/version.txt @@ -12,5 +12,5 @@ version() .. method:: version() - :returns: The version of the :binary:`~bin.mongo` shell as a string. + :returns: The version of :mongosh:`mongosh ` as a string. diff --git a/source/reference/mongo-shell.txt b/source/reference/mongo-shell.txt index 6ee1a11d2d1..3ad6b5bba46 100644 --- a/source/reference/mongo-shell.txt +++ b/source/reference/mongo-shell.txt @@ -36,16 +36,16 @@ The following table displays some common options for :binary:`~bin.mongo`: * - Option - Description - * - :option:`--help ` + * - :option:`--help ` - Show command line options - * - :option:`--nodb ` + * - :option:`--nodb ` - Start :binary:`~bin.mongo` shell without connecting to a database. To connect later, see :ref:`mongo-shell-new-connections`. - * - :option:`--shell ` + * - :option:`--shell ` - Used in conjunction with a JavaScript file (i.e. :ref:`\ `) to continue in the @@ -527,7 +527,7 @@ The following table displays the methods to create the connections: Use ``getDB()`` method of the connection to select a database. See also :ref:`mongo-shell-new-connections` for more information on the -opening new connections from the :binary:`~bin.mongo` shell. +opening new connections from within the :binary:`~bin.mongo` shell. .. _shell-quick-ref-misc: diff --git a/source/reference/mongo.txt b/source/reference/mongo.txt index 89f0d1434a9..2bd0171f9c6 100644 --- a/source/reference/mongo.txt +++ b/source/reference/mongo.txt @@ -31,7 +31,7 @@ Comparison of the ``mongo`` Shell and ``mongosh`` ------------------------------------------------- The new MongoDB Shell (:mongosh:`mongosh `) offers numerous -advantages over the :binary:`~bin.mongo` shell, such as: +advantages over the legacy :binary:`~bin.mongo` shell, such as: - Improved syntax highlighting. @@ -39,18 +39,18 @@ advantages over the :binary:`~bin.mongo` shell, such as: - Improved logging. -The ``mongosh`` currently supports a subset of the older +The ``mongosh`` currently supports a subset of the legacy :binary:`~bin.mongo` shell methods. To maintain backwards compatibility, the methods that the new ``mongosh`` supports use the -same syntax as the corresponding methods in the :binary:`~bin.mongo` -shell. +same syntax as the corresponding methods in the legacy +:binary:`~bin.mongo` shell. The list of methods supported by ``mongosh`` is here: :mongosh:`MongoDB Shell Methods `. .. seealso:: - - :binary:`~bin.mongo` Reference Page + - Legacy :binary:`~bin.mongo` Reference Page - :mongosh:`mongosh Documentation ` .. toctree:: diff --git a/source/reference/mongodb-extended-json-v1.txt b/source/reference/mongodb-extended-json-v1.txt index 9d528db60d8..b465678047e 100644 --- a/source/reference/mongodb-extended-json-v1.txt +++ b/source/reference/mongodb-extended-json-v1.txt @@ -13,13 +13,15 @@ MongoDB Extended JSON (v1) .. important:: Disambiguation - The following page discusses MongoDB Extended JSON v1 (Legacy extended JSON). For discussion on MongoDB Extended JSON v2, see :doc:`/reference/mongodb-extended-json`. - For :binary:`~bin.mongo` shell wrapper methods for types, see - :doc:`/core/shell-types`. + For supported data types in :binary:`~bin.mongo`, see + :mongosh:`mongosh Data Types `. + + For supported data types in the legacy :binary:`~bin.mongo` shell, + see :doc:`/core/shell-types`. :term:`JSON` can only represent a subset of the types supported by :term:`BSON`. To preserve type information, MongoDB adds the following diff --git a/source/reference/mongodb-extended-json.txt b/source/reference/mongodb-extended-json.txt index 2c55c76baf0..d99f2bb0c52 100644 --- a/source/reference/mongodb-extended-json.txt +++ b/source/reference/mongodb-extended-json.txt @@ -12,13 +12,15 @@ MongoDB Extended JSON (v2) .. important:: Disambiguation - The following page discusses MongoDB Extended JSON v2. For discussion on the Legacy MongoDB Extended JSON v1, see :doc:`/reference/mongodb-extended-json-v1`. - For :binary:`~bin.mongo` shell wrapper methods for types, see - :doc:`/core/shell-types`. + For supported data types in :mongosh:`mongosh `, see + :mongosh:`mongosh Data Types `. + + For supported data types in the legacy :binary:`~bin.mongo` shell, + see :doc:`/core/shell-types`. :term:`JSON` can only directly represent a subset of the types supported by :term:`BSON`. To preserve type information, MongoDB adds diff --git a/source/reference/operator/aggregation/accumulator.txt b/source/reference/operator/aggregation/accumulator.txt index e7fc488301a..bcb5f101e3e 100644 --- a/source/reference/operator/aggregation/accumulator.txt +++ b/source/reference/operator/aggregation/accumulator.txt @@ -304,7 +304,7 @@ Use ``$accumulator`` to Implement the ``$avg`` Operator functionality, but to illustrate the behavior and syntax of the :group:`$accumulator` operator with familiar logic. -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``books`` with the following documents: .. code-block:: javascript @@ -427,7 +427,7 @@ useful if you want to, for example: - Set the initial state to a different value based on the group being processed. -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``restaurants`` with the following documents: .. code-block:: javascript @@ -455,7 +455,7 @@ whether the restaurant's city matches the city in the user's profile: .. note:: - To execute this example in the :binary:`~bin.mongo` shell, replace + To execute this example in :mongosh:`mongosh `, replace ```` in the :ref:`initArgs ` with a string containing an actual city value, such as ``Bettles``. diff --git a/source/reference/operator/aggregation/binarySize.txt b/source/reference/operator/aggregation/binarySize.txt index 0453b44d4c4..dc099f3849b 100644 --- a/source/reference/operator/aggregation/binarySize.txt +++ b/source/reference/operator/aggregation/binarySize.txt @@ -123,7 +123,7 @@ Consider the following examples: Example ------- -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``images`` with the following documents: .. code-block:: javascript diff --git a/source/reference/operator/aggregation/bsonSize.txt b/source/reference/operator/aggregation/bsonSize.txt index ff73579b54d..f680ab49d41 100644 --- a/source/reference/operator/aggregation/bsonSize.txt +++ b/source/reference/operator/aggregation/bsonSize.txt @@ -50,7 +50,7 @@ Examples Return Sizes of Documents ~~~~~~~~~~~~~~~~~~~~~~~~~ -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``employees`` with the following documents: .. code-block:: javascript diff --git a/source/reference/operator/aggregation/bucket.txt b/source/reference/operator/aggregation/bucket.txt index 473039e8442..6fbfa469655 100644 --- a/source/reference/operator/aggregation/bucket.txt +++ b/source/reference/operator/aggregation/bucket.txt @@ -196,7 +196,7 @@ Examples Bucket by Year and Filter by Bucket Results ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``artists`` with the following documents: .. code-block:: javascript @@ -329,7 +329,7 @@ Use $bucket with $facet to Bucket by Multiple Fields You can use the :pipeline:`$facet` stage to perform multiple :pipeline:`$bucket` aggregations in a single stage. -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``artwork`` with the following documents: .. code-block:: javascript diff --git a/source/reference/operator/aggregation/currentOp.txt b/source/reference/operator/aggregation/currentOp.txt index 8d970d4858b..02648a00ad2 100644 --- a/source/reference/operator/aggregation/currentOp.txt +++ b/source/reference/operator/aggregation/currentOp.txt @@ -24,16 +24,16 @@ Definition the :method:`db.aggregate()` helper on the ``admin`` database. The :pipeline:`$currentOp` aggregation stage is preferred over the - :dbcommand:`currentOp` command and its :binary:`~bin.mongo` shell - helper :method:`db.currentOp()`. Because :dbcommand:`currentOp` - command and :method:`db.currentOp()` helper returns the results in a - single document, the total size of the :dbcommand:`currentOp` result - set is subject to the maximum 16MB BSON size limit for documents. - The :pipeline:`$currentOp` stage returns a cursor over a stream of - documents, each of which reports a single operation. Each operation - document is subject to the 16MB BSON limit, but unlike the - :dbcommand:`currentOp` command, there is no limit on the overall - size of the result set. + :dbcommand:`currentOp` command and its :mongosh:`mongosh ` + helper method :method:`db.currentOp()`. Because the + :dbcommand:`currentOp` command and :method:`db.currentOp()` helper + method return the results in a single document, the total size of the + :dbcommand:`currentOp` result set is subject to the maximum 16MB BSON + size limit for documents. The :pipeline:`$currentOp` stage returns a + cursor over a stream of documents, each of which reports a single + operation. Each operation document is subject to the 16MB BSON limit, + but unlike the :dbcommand:`currentOp` command, there is no limit on + the overall size of the result set. :pipeline:`$currentOp` also enables you to perform arbitrary transformations of the results as the documents pass through the @@ -927,7 +927,7 @@ relevant for the operation: .. data:: $currentOp.opid The identifier for the operation. You can pass this value to - :method:`db.killOp()` in the :binary:`~bin.mongo` shell to terminate the + :method:`db.killOp()` in :mongosh:`mongosh ` to terminate the operation. .. include:: /includes/extracts/warning-terminating-ops-method.rst diff --git a/source/reference/operator/aggregation/first-array-element.txt b/source/reference/operator/aggregation/first-array-element.txt index e4098b7792a..9f661d22b31 100644 --- a/source/reference/operator/aggregation/first-array-element.txt +++ b/source/reference/operator/aggregation/first-array-element.txt @@ -203,7 +203,7 @@ The operation returns the following documents: { "_id" : 2, "team" : "Bears", "progress" : -2 } { "_id" : 3, "team" : "Cobras", "progress" : "Not enough data." } -By default, the :binary:`~bin.mongo` shell uses the 64-bit floating-point +By default, :mongosh:`mongosh ` uses the 64-bit floating-point double for numbers. To improve precision, you can use :ref:`shell-type-decimal` instead. diff --git a/source/reference/operator/aggregation/group.txt b/source/reference/operator/aggregation/group.txt index d780a255cd7..da33e32d612 100644 --- a/source/reference/operator/aggregation/group.txt +++ b/source/reference/operator/aggregation/group.txt @@ -371,7 +371,7 @@ This aggregation operation is equivalent to the following SQL statement: Pivot Data ~~~~~~~~~~ -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``books`` with the following documents: .. code-block:: javascript diff --git a/source/reference/operator/aggregation/last-array-element.txt b/source/reference/operator/aggregation/last-array-element.txt index 6abd1cbd9b5..1dc953d98aa 100644 --- a/source/reference/operator/aggregation/last-array-element.txt +++ b/source/reference/operator/aggregation/last-array-element.txt @@ -200,7 +200,7 @@ The operation returns the following documents: { "_id" : 2, "team" : "Bears", "progress" : -2 } { "_id" : 3, "team" : "Cobras", "progress" : "Not enough data." } -By default, the :binary:`~bin.mongo` shell uses the 64-bit floating-point +By default, :mongosh:`mongosh ` uses the 64-bit floating-point double for numbers. To improve precision, you can use :ref:`shell-type-decimal` instead. diff --git a/source/reference/operator/aggregation/map.txt b/source/reference/operator/aggregation/map.txt index d9173ea31b9..a9c4c5d42d0 100644 --- a/source/reference/operator/aggregation/map.txt +++ b/source/reference/operator/aggregation/map.txt @@ -59,7 +59,7 @@ Examples Add to each element of an array using ``$map`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``grades`` with the following documents: .. code-block:: javascript @@ -105,7 +105,7 @@ This operation returns the following results: Truncate each array element with ``$map`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``deliveries`` with the following documents: .. code-block:: javascript @@ -151,7 +151,7 @@ This operation returns the following results: Convert Celsius Temperatures to Fahrenheit Using ``$map`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``temperatures`` with the following documents: .. code-block:: javascript diff --git a/source/reference/operator/aggregation/redact.txt b/source/reference/operator/aggregation/redact.txt index cd165139c1c..a1cffe175ca 100644 --- a/source/reference/operator/aggregation/redact.txt +++ b/source/reference/operator/aggregation/redact.txt @@ -68,7 +68,7 @@ Examples The examples in this section use the :method:`db.collection.aggregate()` helper provided in the 2.6 version -of the :binary:`~bin.mongo` shell. +of :mongosh:`mongosh `. Evaluate Access at Every Document Level ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/reference/operator/aggregation/unwind.txt b/source/reference/operator/aggregation/unwind.txt index a5fe495fcb8..e5c7a219af9 100644 --- a/source/reference/operator/aggregation/unwind.txt +++ b/source/reference/operator/aggregation/unwind.txt @@ -143,7 +143,7 @@ Examples Unwind Array ~~~~~~~~~~~~ -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``inventory`` with the following document: .. code-block:: javascript @@ -175,7 +175,7 @@ of the ``sizes`` field which now holds a value from the original .. versionadded:: 3.2 -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``inventory2`` with the following documents: .. code-block:: javascript @@ -272,7 +272,7 @@ null, missing, or an empty array: Group by Unwound Values ~~~~~~~~~~~~~~~~~~~~~~~ -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``inventory2`` with the following documents: .. code-block:: javascript @@ -361,7 +361,7 @@ Third Stage: Unwind Embedded Arrays ~~~~~~~~~~~~~~~~~~~~~~ -From the :binary:`~bin.mongo` shell, create a sample collection named +In :mongosh:`mongosh `, create a sample collection named ``sales`` with the following documents: .. code-block:: javascript diff --git a/source/reference/operator/meta/explain.txt b/source/reference/operator/meta/explain.txt index dea5e74d8b1..5ce469f86c5 100644 --- a/source/reference/operator/meta/explain.txt +++ b/source/reference/operator/meta/explain.txt @@ -29,7 +29,7 @@ $explain db.collection.find()._addSpecial( "$explain", 1 ) db.collection.find( { $query: {}, $explain: 1 } ) - In the :binary:`~bin.mongo` shell, you also can retrieve query plan + In :mongosh:`mongosh `, you also can retrieve query plan information through the :method:`~cursor.explain()` method: .. code-block:: javascript diff --git a/source/reference/operator/meta/hint.txt b/source/reference/operator/meta/hint.txt index cf91c50c4f6..9376be980c1 100644 --- a/source/reference/operator/meta/hint.txt +++ b/source/reference/operator/meta/hint.txt @@ -20,7 +20,7 @@ $hint document. Use :operator:`$hint` for testing query performance and indexing - strategies. The :binary:`~bin.mongo` shell provides a helper method + strategies. :mongosh:`mongosh ` provides a helper method :method:`~cursor.hint()` for the :operator:`$hint` operator. Consider the following operation: diff --git a/source/reference/operator/meta/max.txt b/source/reference/operator/meta/max.txt index a77e8984020..5b5362bae35 100644 --- a/source/reference/operator/meta/max.txt +++ b/source/reference/operator/meta/max.txt @@ -22,7 +22,7 @@ Definition :method:`~db.collection.find()`. The :operator:`$max` specifies the upper bound for *all* keys of a specific index *in order*. - The :binary:`~bin.mongo` shell provides the :method:`~cursor.max()` + :mongosh:`mongosh ` provides the :method:`~cursor.max()` wrapper method: .. code-block:: javascript @@ -84,7 +84,7 @@ If you use :operator:`$max` with :operator:`$min` to specify a range: Examples -------- -The following examples use the :binary:`~bin.mongo` shell wrappers. +The following examples use :mongosh:`mongosh ` wrappers. Specify Exclusive Upper Bound ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/reference/operator/meta/maxTimeMS.txt b/source/reference/operator/meta/maxTimeMS.txt index 346850ee9b3..65197533de4 100644 --- a/source/reference/operator/meta/maxTimeMS.txt +++ b/source/reference/operator/meta/maxTimeMS.txt @@ -19,7 +19,7 @@ $maxTimeMS cursor. MongoDB interrupts the operation at the earliest following :term:`interrupt point`. - The :binary:`~bin.mongo` shell provides the :method:`cursor.maxTimeMS()` method + :mongosh:`mongosh ` provides the :method:`cursor.maxTimeMS()` method .. code-block:: javascript diff --git a/source/reference/operator/meta/min.txt b/source/reference/operator/meta/min.txt index 72e4aca1787..d459fab9cce 100644 --- a/source/reference/operator/meta/min.txt +++ b/source/reference/operator/meta/min.txt @@ -22,7 +22,7 @@ Definition :method:`~db.collection.find()`. The :operator:`$min` specifies the lower bound for *all* keys of a specific index *in order*. - The :binary:`~bin.mongo` shell provides the :method:`~cursor.min()` + :mongosh:`mongosh ` provides the :method:`~cursor.min()` wrapper method: .. code-block:: javascript @@ -85,7 +85,7 @@ If you use :operator:`$max` with :operator:`$min` to specify a range, Examples -------- -The following examples use the :binary:`~bin.mongo` shell wrappers. +The following examples use :mongosh:`mongosh ` wrappers. Specify Inclusive Lower Bound ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/reference/operator/meta/orderby.txt b/source/reference/operator/meta/orderby.txt index 508ccac05c2..a82b33b910c 100644 --- a/source/reference/operator/meta/orderby.txt +++ b/source/reference/operator/meta/orderby.txt @@ -17,7 +17,7 @@ $orderby The :operator:`$orderby` operator sorts the results of a query in ascending or descending order. - The :binary:`~bin.mongo` shell provides the :method:`cursor.sort()` + :mongosh:`mongosh ` provides the :method:`cursor.sort()` method: .. code-block:: javascript diff --git a/source/reference/operator/meta/query.txt b/source/reference/operator/meta/query.txt index 85a62b9792f..699e14d7d5b 100644 --- a/source/reference/operator/meta/query.txt +++ b/source/reference/operator/meta/query.txt @@ -20,7 +20,7 @@ Definition The :operator:`$query` operator forces MongoDB to interpret an expression as a query. - The following :binary:`~bin.mongo` operations are equivalent, and + The following :mongosh:`mongosh ` operations are equivalent, and return only those documents in the collection named ``collection`` where the ``age`` field equals ``25``. diff --git a/source/reference/operator/meta/showDiskLoc.txt b/source/reference/operator/meta/showDiskLoc.txt index 8c798921139..3fa8831e60d 100644 --- a/source/reference/operator/meta/showDiskLoc.txt +++ b/source/reference/operator/meta/showDiskLoc.txt @@ -25,7 +25,7 @@ $showDiskLoc "offset": } - The :binary:`~bin.mongo` shell provides the + :mongosh:`mongosh ` provides the ``cursor.showDiskLoc()`` method for :operator:`$showDiskLoc`: .. code-block:: javascript diff --git a/source/reference/operator/update/bit.txt b/source/reference/operator/update/bit.txt index a56a542c310..4b058926d58 100644 --- a/source/reference/operator/update/bit.txt +++ b/source/reference/operator/update/bit.txt @@ -32,7 +32,7 @@ Definition .. note:: - All numbers in the :binary:`~bin.mongo` shell are doubles, not + All numbers in :mongosh:`mongosh ` are doubles, not integers. Use the ``NumberInt()`` or the ``NumberLong()`` constructor to specify integers. See :ref:`shell-type-int` or :ref:`shell-type-long` for more information. @@ -82,7 +82,7 @@ And the updated document has the following value for ``expdata``: { "_id" : 1, "expdata" : 8 } -The :binary:`~bin.mongo` shell displays ``NumberInt(8)`` as ``8``. +:mongosh:`mongosh ` displays ``NumberInt(8)`` as ``8``. Bitwise OR ~~~~~~~~~~ diff --git a/source/reference/parameters.txt b/source/reference/parameters.txt index c48183623cb..184cfa95f96 100644 --- a/source/reference/parameters.txt +++ b/source/reference/parameters.txt @@ -513,8 +513,8 @@ Authentication Parameters mongod --setParameter scramIterationCount=12000 - Or, if using the :dbcommand:`setParameter` command within the - :binary:`~bin.mongo` shell: + Or, if using the :dbcommand:`setParameter` command within + :mongosh:`mongosh `: .. code-block:: javascript @@ -551,8 +551,8 @@ Authentication Parameters mongod --setParameter scramSHA256IterationCount=20000 - Or, if using the :dbcommand:`setParameter` command within the - :binary:`~bin.mongo` shell: + Or, if using the :dbcommand:`setParameter` command within + :mongosh:`mongosh `: .. code-block:: javascript @@ -1013,8 +1013,8 @@ General Parameters mongod --setParameter cursorTimeoutMillis=300000 - Or, if using the :dbcommand:`setParameter` command within the - :binary:`~bin.mongo` shell: + Or, if using the :dbcommand:`setParameter` command within + :mongosh:`mongosh `: .. code-block:: javascript @@ -1604,7 +1604,7 @@ Logging Parameters mongod --setParameter "logComponentVerbosity={command: 3}" - The :binary:`~bin.mongo` shell also provides the :method:`db.setLogLevel()` + :mongosh:`mongosh ` also provides the :method:`db.setLogLevel()` to set the log level for a single component. For various ways to set the log verbosity level, see :ref:`log-messages-configure-verbosity`. @@ -2513,7 +2513,7 @@ Logical Session mirrorReads: '{samplingRate: 0.10}' Or if using the :dbcommand:`setParameter` command in a - :binary:`~bin.mongo` shell connected to a running + :mongosh:`mongosh ` session that is connected to a running :binary:`~bin.mongod`, do **not** enclose the document in quotes: .. code-block:: javascript @@ -2693,7 +2693,7 @@ Sharding Parameters mongos --setParameter maxTimeMSForHedgedReads=200 Or if using the :dbcommand:`setParameter` command in a - :binary:`~bin.mongo` shell connected to a running + :mongosh:`mongosh ` session that is connected to a running :binary:`~bin.mongos`: .. code-block:: javascript @@ -2750,7 +2750,7 @@ Sharding Parameters mongos --setParameter readHedgingMode=off Or if using the :dbcommand:`setParameter` command in a - :binary:`~bin.mongo` shell connected to a running + :mongosh:`mongosh ` session that is connected to a running :binary:`~bin.mongos`: .. code-block:: javascript @@ -2784,7 +2784,7 @@ Sharding Parameters mongod --setParameter shutdownTimeoutMillisForSignaledShutdown=250 Or if using the :dbcommand:`setParameter` command in a - :binary:`~bin.mongo` shell connected to a running + :mongosh:`mongosh ` session that is connected to a running :binary:`~bin.mongod`: .. code-block:: javascript @@ -2813,7 +2813,7 @@ Sharding Parameters mongos --setParameter mongosShutdownTimeoutMillisForSignaledShutdown=250 Or if using the :dbcommand:`setParameter` command in a - :binary:`~bin.mongo` shell connected to a running + :mongosh:`mongosh ` session that is connected to a running :binary:`~bin.mongos`: .. code-block:: javascript diff --git a/source/reference/program.txt b/source/reference/program.txt index 95867e2ec79..36a76baf5ac 100644 --- a/source/reference/program.txt +++ b/source/reference/program.txt @@ -26,7 +26,7 @@ The core components in the MongoDB package are: - the controller and query router for :term:`sharded clusters ` - * - :binary:`~bin.mongo` + * - :mongosh:`mongosh ` - the interactive shell diff --git a/source/reference/program/mongo.txt b/source/reference/program/mongo.txt index 7a771bfba06..e5ea9907dcb 100644 --- a/source/reference/program/mongo.txt +++ b/source/reference/program/mongo.txt @@ -8,9 +8,9 @@ .. program:: mongo -========= -``mongo`` -========= +====================== +Legacy ``mongo`` Shell +====================== .. contents:: On this page :local: @@ -23,6 +23,22 @@ :description: The mongo shell command man page. :keywords: mongo, mongodb, man page, mongo process, mongo shell +.. note:: + + The ``mongo`` shell has been deprecated in MongoDB v5.0. The + replacement is :mongosh:`mongosh `. + + Older ``mongo`` shell documentation is included with the + corresponding documentation for that ``MongoDB`` release. + + *Quick Links to prior versions* + + - :v4.4:`mongo shell v4.4 ` + - :v4.2:`mongo shell v4.2 ` + - :v4.0:`mongo shell v4.0 ` + + See :ref:`compare-mongosh-mongo` for more information. + Description ----------- diff --git a/source/reference/program/mongod.txt b/source/reference/program/mongod.txt index 2ba5f22facb..df345ebf037 100644 --- a/source/reference/program/mongod.txt +++ b/source/reference/program/mongod.txt @@ -742,7 +742,7 @@ Core Options - other members of the deployment if the instance is part of a replica set or a sharded cluster - - a :binary:`~bin.mongo` shell + - :mongosh:`mongosh ` - drivers that support the ``OP_COMPRESSED`` message format. diff --git a/source/reference/program/mongokerberos.txt b/source/reference/program/mongokerberos.txt index f6471789c30..9c176fce73e 100644 --- a/source/reference/program/mongokerberos.txt +++ b/source/reference/program/mongokerberos.txt @@ -210,7 +210,7 @@ Kerberos authentication process, including checking for proper DNS resolution, verification of the Kerberos client keytab file, and testing whether a ticket can be successfully granted. Running :binary:`~bin.mongokerberos` in client mode simulates the client -authentication procedure of the :binary:`~bin.mongo` shell. +authentication procedure of :mongosh:`mongosh `. Before you can use :binary:`~bin.mongokerberos` in client mode, you must first have configured Kerberos on your platform according to your @@ -293,7 +293,7 @@ Options client mode. :binary:`~bin.mongokerberos` will request a Kerberos ticket for this username as part of the validation procedure. Running :binary:`~bin.mongokerberos` in client mode simulates the client - authentication procedure of the :binary:`~bin.mongo` shell. + authentication procedure of :mongosh:`mongosh `. See :ref:`mongokeberos-usage-client` for example usage and expected output. diff --git a/source/reference/program/mongos.txt b/source/reference/program/mongos.txt index de4cd79bc77..2f6da81a27d 100644 --- a/source/reference/program/mongos.txt +++ b/source/reference/program/mongos.txt @@ -573,7 +573,7 @@ Core Options - other members of the sharded cluster - - a :binary:`~bin.mongo` shell + - :mongosh:`mongosh ` - drivers that support the ``OP_COMPRESSED`` message format. diff --git a/source/reference/read-concern.txt b/source/reference/read-concern.txt index 278d04f1cd0..23e3791f8ea 100644 --- a/source/reference/read-concern.txt +++ b/source/reference/read-concern.txt @@ -234,7 +234,7 @@ option to commands and methods that support read concern: readConcern: { level: } -To specify the read concern level for the :binary:`~bin.mongo` shell +To specify the read concern level for :mongosh:`mongosh ` method :method:`db.collection.find()`, use the :method:`cursor.readConcern()` method: diff --git a/source/reference/replica-set-protocol-versions.txt b/source/reference/replica-set-protocol-versions.txt index 16e6f4fe6aa..f8766827549 100644 --- a/source/reference/replica-set-protocol-versions.txt +++ b/source/reference/replica-set-protocol-versions.txt @@ -97,8 +97,8 @@ Before changing the protocol version for MongoDB 3.2 through MongoDB protocol version) has replicated from the primary to all secondaries. To check, on each secondary, check the :data:`optimes.lastCommittedOpTime.t ` field returned from -:method:`rs.status()`. For example, connect a :binary:`~bin.mongo` -shell to each secondary and run: +:method:`rs.status()`. For example, connect :mongosh:`mongosh ` to +each secondary and run: .. code-block:: javascript @@ -117,7 +117,7 @@ the protocol version. To change the replica set protocol version, reconfigure (:method:`rs.reconfig`) the replica set with the new :rsconf:`protocolVersion`. For example, to upgrade to ``pv1``, connect -a :binary:`~bin.mongo` shell to the current primary and perform the +:mongosh:`mongosh ` to the current primary and perform the following sequence of operations: .. code-block:: bash diff --git a/source/reference/security-client-side-automatic-json-schema.txt b/source/reference/security-client-side-automatic-json-schema.txt index d76ef1ce63c..81d8176f36c 100644 --- a/source/reference/security-client-side-automatic-json-schema.txt +++ b/source/reference/security-client-side-automatic-json-schema.txt @@ -46,10 +46,10 @@ both the client *and* the server. The following automatic encryption rules for the ``hr.employees`` collection mark the ``taxid`` and ``taxid-short`` fields for automatic client-side field level encryption. Official MongoDB 4.2+ compatible :ref:`drivers -` and the 4.2 or later -:binary:`~bin.mongo` shell configured with these rules automatically -encrypt the ``taxid`` and ``taxid-short`` fields for write or read -operations to the ``hr.employees`` collection. +`, :mongosh:`mongosh `, and the 4.2 +or later legacy :binary:`~bin.mongo` shell configured with these rules +automatically encrypt the ``taxid`` and ``taxid-short`` fields for write +or read operations to the ``hr.employees`` collection. .. code-block:: json :emphasize-lines: 5-9, 12-16 @@ -485,9 +485,10 @@ encryption rules specified :autoencryptkeyword:`encrypt` or ``medicalRecords.additionalItems``, automatic field level encryption fails and returns an errors. -The official MongoDB 4.2+ compatible drivers and the -:binary:`~bin.mongo` shell require specifying the automatic -encryption rules as part of creating the database connection object: +The official MongoDB 4.2+ compatible drivers, :mongosh:`mongosh `, +and the 4.2 or later legacy :binary:`~bin.mongo` shell require +specifying the automatic encryption rules as part of creating the +database connection object: - For the MongoDB 4.2 or later shell, use the :method:`Mongo()` constructor to create a database connection. Specify the automatic @@ -633,9 +634,10 @@ encryption rules specified :autoencryptkeyword:`encrypt` or ``medicalRecords.additionalItems``, automatic field level encryption fails and returns an errors. -The official MongoDB 4.2+ compatible drivers and the -:binary:`~bin.mongo` shell require specifying the automatic -encryption rules as part of creating the database connection object: +The official MongoDB 4.2+ compatible drivers, :mongosh:`mongosh `, +and the 4.2 or later legacy :binary:`~bin.mongo` shell require +specifying the automatic encryption rules as part of creating the +database connection object: - For the MongoDB 4.2 or later shell, use the :method:`Mongo()` constructor to create a database connection. Specify the automatic diff --git a/source/reference/security-client-side-encryption-appendix.txt b/source/reference/security-client-side-encryption-appendix.txt index c05a8592001..80020bad590 100644 --- a/source/reference/security-client-side-encryption-appendix.txt +++ b/source/reference/security-client-side-encryption-appendix.txt @@ -46,12 +46,12 @@ Apache-licensed `libmongocrypt `__ library for performing client-side field level encryption and automatic decryption. -The official MongoDB 4.2+ compatible drivers and the 4.2 or later -:binary:`~bin.mongo` shell require access to the ``mongocryptd`` process -on the client host machine. The 4.2+ compatible drivers and 4.2 or later -:binary:`~bin.mongo` shell search for the ``mongocryptd`` process in the -system PATH by default. See :ref:`mongocryptd-installation` for the -complete documentation on installing ``mongocryptd``. +The official MongoDB 4.2+ compatible drivers, :mongosh:`mongosh `, +and the 4.2 or later legacy :binary:`~bin.mongo` shell require access to +the ``mongocryptd`` process on the client host machine. These clients +search for the ``mongocryptd`` process in the system PATH by default. +See :ref:`mongocryptd-installation` for the complete documentation on +installing ``mongocryptd``. Usage ~~~~~ diff --git a/source/reference/security.txt b/source/reference/security.txt index 2e44579d3eb..bba239236dd 100644 --- a/source/reference/security.txt +++ b/source/reference/security.txt @@ -83,7 +83,7 @@ User Management and Authentication Methods * - :method:`passwordPrompt()` - Prompts for the password as an alternative to specifying passwords - directly in various :binary:`~bin.mongo` shell user + directly in various :mongosh:`mongosh ` user authentication/management methods. diff --git a/source/reference/sql-comparison.txt b/source/reference/sql-comparison.txt index 4371f59ee1a..a28a01b5188 100644 --- a/source/reference/sql-comparison.txt +++ b/source/reference/sql-comparison.txt @@ -121,7 +121,7 @@ exhaustive. * - Database Client - - :binary:`~bin.mongo` + - :mongosh:`mongosh ` - ``mysql`` diff --git a/source/reference/versioned-api.txt b/source/reference/versioned-api.txt index 96fdd7e522f..b95292e67c1 100644 --- a/source/reference/versioned-api.txt +++ b/source/reference/versioned-api.txt @@ -167,7 +167,7 @@ clients are *non-strict* unless specified otherwise in the connection. api={"version": "1", "strict": False} ) -If you are running the :binary:`~bin.mongo` shell, you can create a +If you are running :mongosh:`mongosh `, you can create a non-strict client by specifying :option:`--apiVersion` and omitting the :option:`--apiStrict` option. diff --git a/source/tutorial/access-mongo-shell-help.txt b/source/tutorial/access-mongo-shell-help.txt index 8d603ff53e8..54dae5805ff 100644 --- a/source/tutorial/access-mongo-shell-help.txt +++ b/source/tutorial/access-mongo-shell-help.txt @@ -25,7 +25,7 @@ Command Line Help ----------------- To see the list of options and help for starting the :binary:`~bin.mongo` -shell, use the :option:`--help ` option from the command line: +shell, use the :option:`--help ` option from the command line: .. code-block:: bash diff --git a/source/tutorial/add-shards-to-shard-cluster.txt b/source/tutorial/add-shards-to-shard-cluster.txt index 85d437da747..83f2d3233fa 100644 --- a/source/tutorial/add-shards-to-shard-cluster.txt +++ b/source/tutorial/add-shards-to-shard-cluster.txt @@ -40,7 +40,7 @@ Add a Shard to a Cluster You interact with a sharded cluster by connecting to a :binary:`~bin.mongos` instance. -1. From a :binary:`~bin.mongo` shell, connect to the :binary:`~bin.mongos` +1. In :mongosh:`mongosh `, connect to the :binary:`~bin.mongos` instance. For example, if a :binary:`~bin.mongos` is accessible at ``mongos0.example.net`` on port ``27017``, issue the following command: diff --git a/source/tutorial/aggregation-zip-code-data-set.txt b/source/tutorial/aggregation-zip-code-data-set.txt index b7ba20c72cd..ba3efc7eb2d 100644 --- a/source/tutorial/aggregation-zip-code-data-set.txt +++ b/source/tutorial/aggregation-zip-code-data-set.txt @@ -49,7 +49,7 @@ Each document in the ``zipcodes`` collection has the following form: ---------------------- All of the following examples use the :method:`aggregate() -` helper in the :binary:`~bin.mongo` shell. +` helper in :mongosh:`mongosh `. The :method:`aggregate() ` method uses the :ref:`aggregation pipeline ` to process @@ -59,8 +59,8 @@ documents into aggregated results. An :ref:`aggregation pipeline the documents as they pass along the pipeline. Documents pass through the stages in sequence. -The :method:`aggregate() ` method in the -:binary:`~bin.mongo` shell provides a wrapper around the +The :method:`aggregate() ` method in +:mongosh:`mongosh ` provides a wrapper around the :dbcommand:`aggregate` database command. See the documentation for your :driver:`driver ` for a more idiomatic interface for data aggregation operations. diff --git a/source/tutorial/build-indexes-on-replica-sets.txt b/source/tutorial/build-indexes-on-replica-sets.txt index 2751e150778..858dd6bb715 100644 --- a/source/tutorial/build-indexes-on-replica-sets.txt +++ b/source/tutorial/build-indexes-on-replica-sets.txt @@ -164,7 +164,7 @@ Connect directly to the :binary:`~bin.mongod` instance running as a standalone on the new port and create the new index for this instance. -For example, connect a :binary:`~bin.mongo` shell to the instance, and +For example, connect :mongosh:`mongosh ` to the instance, and use the :method:`~db.collection.createIndex()` to create an ascending index on the ``username`` field of the ``records`` collection: @@ -265,7 +265,7 @@ When all the secondaries have the new index, step down the primary, restart it as a standalone using the procedure described above, and build the index on the former primary: -#. Use the :method:`rs.stepDown()` method in the :binary:`~bin.mongo` shell +#. Use the :method:`rs.stepDown()` method in :mongosh:`mongosh ` to step down the primary. Upon successful stepdown, the current primary becomes a secondary and the replica set members elect a new primary. diff --git a/source/tutorial/build-indexes-on-sharded-clusters.txt b/source/tutorial/build-indexes-on-sharded-clusters.txt index c078a694d9e..021c553fa64 100644 --- a/source/tutorial/build-indexes-on-sharded-clusters.txt +++ b/source/tutorial/build-indexes-on-sharded-clusters.txt @@ -89,7 +89,7 @@ Procedure A. Stop the Balancer ~~~~~~~~~~~~~~~~~~~~ -Connect a :binary:`~bin.mongo` shell to a :binary:`~bin.mongos` +Connect :mongosh:`mongosh ` to a :binary:`~bin.mongos` instance in the sharded cluster, and run :method:`sh.stopBalancer()` to disable the balancer: [#autosplit-stop]_ @@ -119,7 +119,7 @@ is disabled: B. Determine the Distribution of the Collection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -From the :binary:`~bin.mongo` shell connected to the +From :mongosh:`mongosh ` connected to the :binary:`~bin.mongos`, refresh the cached routing table for that :binary:`~bin.mongos` to avoid returning stale distribution information for the collection. Once refreshed, run @@ -280,7 +280,7 @@ Connect directly to the :binary:`~bin.mongod` instance running as a standalone on the new port and create the new index for this instance. -For example, connect a :binary:`~bin.mongo` shell to the instance, +For example, connect :mongosh:`mongosh ` to the instance, and use the :method:`db.collection.createIndex()` method to create an ascending index on the ``username`` field of the ``records`` collection: @@ -394,7 +394,7 @@ When all the secondaries for the shard have the new index, step down the primary for the shard, restart it as a standalone using the procedure described above, and build the index on the former primary: -#. Use the :method:`rs.stepDown()` method in the :binary:`~bin.mongo` shell +#. Use the :method:`rs.stepDown()` method in :mongosh:`mongosh ` to step down the primary. Upon successful stepdown, the current primary becomes a secondary and the replica set members elect a new primary. @@ -417,7 +417,7 @@ E. Restart the Balancer Once you finish the rolling index build for the affected shards, restart the balancer. -Connect a :binary:`~bin.mongo` shell to a :binary:`~bin.mongos` +Connect :mongosh:`mongosh ` to a :binary:`~bin.mongos` instance in the sharded cluster, and run :method:`sh.startBalancer()`: [#autosplit-start]_ .. code-block:: javascript diff --git a/source/tutorial/change-hostnames-in-a-replica-set.txt b/source/tutorial/change-hostnames-in-a-replica-set.txt index a2b64f61fa3..eeb20a5328a 100644 --- a/source/tutorial/change-hostnames-in-a-replica-set.txt +++ b/source/tutorial/change-hostnames-in-a-replica-set.txt @@ -112,9 +112,9 @@ This procedure uses the above :ref:`assumptions ` to the replica set's primary. In + our example, the primary runs on port ``27017`` so you would + issue the following command: .. code-block:: bash @@ -144,8 +144,8 @@ This procedure uses the above :ref:`assumptions ` to the primary and step down the + primary using the :method:`rs.stepDown()` method: .. code-block:: javascript @@ -172,10 +172,10 @@ This procedure uses the above :ref:`assumptions ` to the new primary. -#. To confirm the new configuration, call :method:`rs.conf()` in the - :binary:`~bin.mongo` shell. +#. To confirm the new configuration, call :method:`rs.conf()` in + :mongosh:`mongosh `. Your output should resemble: @@ -276,7 +276,7 @@ Procedure #. For each member of the replica set, perform the following sequence of operations: - a. Open a :binary:`~bin.mongo` shell connected to the :binary:`~bin.mongod` + a. Connect :mongosh:`mongosh ` to the :binary:`~bin.mongod` running on the new, temporary port. For example, for a member running on a temporary port of ``37017``, you would issue this command: @@ -328,14 +328,14 @@ Procedure mongod --dbpath /data/db1/ --port 27017 --replSet rs --bind_ip localhost, #. Connect to one of the :binary:`~bin.mongod` instances - using the :binary:`~bin.mongo` shell. For example: + using :mongosh:`mongosh `. For example: .. code-block:: bash mongo --port 27017 -#. To confirm the new configuration, call :method:`rs.conf()` in the - :binary:`~bin.mongo` shell. +#. To confirm the new configuration, call :method:`rs.conf()` in + :mongosh:`mongosh `. Your output should resemble: diff --git a/source/tutorial/change-oplog-size.txt b/source/tutorial/change-oplog-size.txt index 59a8d89b6fb..7ff6f2840ca 100644 --- a/source/tutorial/change-oplog-size.txt +++ b/source/tutorial/change-oplog-size.txt @@ -37,7 +37,7 @@ members, perform these steps on the :term:`primary`. A. Connect to the replica set member ------------------------------------ -Connect to the replica set member using the :binary:`~bin.mongo` shell: +Connect to the replica set member using :mongosh:`mongosh `: .. code-block:: bash diff --git a/source/tutorial/change-replica-set-wiredtiger.txt b/source/tutorial/change-replica-set-wiredtiger.txt index 0ab11192396..603422f66e2 100644 --- a/source/tutorial/change-replica-set-wiredtiger.txt +++ b/source/tutorial/change-replica-set-wiredtiger.txt @@ -105,7 +105,7 @@ B. Step down the primary. the primary. Once all the secondary members have been upgraded to WiredTiger, -connect a :binary:`~bin.mongo` shell to the primary and use +connect :mongosh:`mongosh ` to the primary and use :method:`rs.stepDown()` to step down the primary and force an election of a new primary. diff --git a/source/tutorial/change-sharded-cluster-wiredtiger.txt b/source/tutorial/change-sharded-cluster-wiredtiger.txt index dd5a8ceb2da..cb1f0190087 100644 --- a/source/tutorial/change-sharded-cluster-wiredtiger.txt +++ b/source/tutorial/change-sharded-cluster-wiredtiger.txt @@ -116,7 +116,7 @@ B. Step down the primary. ~~~~~~~~~~~~~~~~~~~~~~~~~ Once all the secondary members have been upgraded to WiredTiger, -connect a :binary:`~bin.mongo` shell to the primary and use +connect :mongosh:`mongosh ` to the primary and use :method:`rs.stepDown()` to step down the primary and force an election of a new primary. diff --git a/source/tutorial/configure-a-delayed-replica-set-member.txt b/source/tutorial/configure-a-delayed-replica-set-member.txt index 243b6541969..c6f37c0ab9d 100644 --- a/source/tutorial/configure-a-delayed-replica-set-member.txt +++ b/source/tutorial/configure-a-delayed-replica-set-member.txt @@ -38,8 +38,8 @@ Example The following example sets a 1-hour delay on a secondary member currently at the index ``0`` in the :rsconf:`members` array. To set the delay, issue -the following sequence of operations in a :binary:`~bin.mongo` shell -connected to the primary: +the following sequence of operations in a :mongosh:`mongosh ` session +that is connected to the primary: .. code-block:: javascript diff --git a/source/tutorial/configure-a-hidden-replica-set-member.txt b/source/tutorial/configure-a-hidden-replica-set-member.txt index 04d26864c8a..99f393820f0 100644 --- a/source/tutorial/configure-a-hidden-replica-set-member.txt +++ b/source/tutorial/configure-a-hidden-replica-set-member.txt @@ -54,8 +54,8 @@ Configuration Procedure The following example hides the secondary member currently at the index ``0`` in the :rsconf:`members` array. To configure a :term:`hidden member`, use the following sequence of operations in a -:binary:`~bin.mongo` shell connected to the primary, specifying the member -to configure by its array index in the +:mongosh:`mongosh ` session that is connected to the primary, +specifying the member to configure by its array index in the :rsconf:`members` array: .. code-block:: javascript diff --git a/source/tutorial/configure-a-non-voting-replica-set-member.txt b/source/tutorial/configure-a-non-voting-replica-set-member.txt index e459ed04209..8b5b2279a83 100644 --- a/source/tutorial/configure-a-non-voting-replica-set-member.txt +++ b/source/tutorial/configure-a-non-voting-replica-set-member.txt @@ -15,7 +15,7 @@ distribution beyond the maximum seven voting members. To configure a member as non-voting, use the :dbcommand:`replSetReconfig` command *or* its -:binary:`~bin.mongo` shell helper :method:`rs.reconfig()` to set its +:mongosh:`mongosh ` helper method :method:`rs.reconfig()` to set its :rsconf:`members[n].votes` and :rsconf:`members[n].priority` values to ``0``. Non-voting replica set members *must* have a :rsconf:`~members[n].priority` of ``0``. @@ -39,8 +39,7 @@ down using :dbcommand:`replSetStepDown` or its shell helper :method:`rs.stepDown()` before performing this procedure. \1) Connect to the Replica Set Primary - Connect a :binary:`~bin.mongo` shell to the replica set - :term:`primary`: + Connect :mongosh:`mongosh ` to the replica set :term:`primary`: .. code-block:: bash diff --git a/source/tutorial/configure-mongo-shell.txt b/source/tutorial/configure-mongo-shell.txt index f4664c66aa6..2f2c5a2a7ae 100644 --- a/source/tutorial/configure-mongo-shell.txt +++ b/source/tutorial/configure-mongo-shell.txt @@ -20,8 +20,8 @@ Customize the Prompt You may modify the content of the prompt by setting the variable ``prompt`` in the :binary:`~bin.mongo` shell. The ``prompt`` variable can hold strings as well as JavaScript code. If ``prompt`` holds a function -that returns a string, :binary:`~bin.mongo` can display dynamic information -in each prompt. +that returns a string, the :binary:`~bin.mongo` shell can display +dynamic information in each prompt. You can add the logic for the prompt in the :ref:`.mongorc.js ` file to set the prompt each time you start up the @@ -137,12 +137,13 @@ following example: .. note:: - As :binary:`~bin.mongo` shell interprets code edited in an external - editor, it may modify code in functions, depending on the - JavaScript compiler. For example, :binary:`~bin.mongo` may convert ``1+1`` to - ``2`` or remove comments. The actual changes affect only the - appearance of the code and will vary based on the version of - JavaScript used but will not affect the semantics of the code. + As the :binary:`~bin.mongo` shell interprets code edited in an + external editor, it may modify code in functions, depending on the + JavaScript compiler. For example, the :binary:`~bin.mongo` shell may + convert ``1+1`` to ``2`` or remove comments. The actual changes + affect only the appearance of the code and will vary based on the + version of JavaScript used but will not affect the semantics of the + code. Change the ``mongo`` Shell Batch Size ------------------------------------- @@ -150,8 +151,8 @@ Change the ``mongo`` Shell Batch Size The :method:`db.collection.find()` method is the JavaScript method to retrieve documents from a :term:`collection`. The :method:`db.collection.find()` method returns a :term:`cursor` to the -results; however, in the :binary:`~bin.mongo` shell, if the returned cursor -is not assigned to a variable using the ``var`` keyword, then the +results; however, in the :binary:`~bin.mongo` shell, if the returned +cursor is not assigned to a variable using the ``var`` keyword, then the cursor is automatically iterated up to 20 times to print up to the first 20 documents that match the query. The :binary:`~bin.mongo` shell will prompt ``Type it`` to iterate another 20 times. diff --git a/source/tutorial/configure-replica-set-secondary-sync-target.txt b/source/tutorial/configure-replica-set-secondary-sync-target.txt index 09789065000..c887c920573 100644 --- a/source/tutorial/configure-replica-set-secondary-sync-target.txt +++ b/source/tutorial/configure-replica-set-secondary-sync-target.txt @@ -31,7 +31,7 @@ this functionality: - :dbcommand:`replSetSyncFrom` command, or -- :method:`rs.syncFrom()` helper in the :binary:`~bin.mongo` shell +- :method:`rs.syncFrom()` helper in :mongosh:`mongosh ` Considerations -------------- @@ -41,13 +41,13 @@ Considerations Procedure --------- -To use the :dbcommand:`replSetSyncFrom` command in the :binary:`~bin.mongo` shell: +To use the :dbcommand:`replSetSyncFrom` command in :mongosh:`mongosh `: .. code-block:: javascript db.adminCommand( { replSetSyncFrom: "hostname<:port>" } ); -To use the :method:`rs.syncFrom()` helper in the :binary:`~bin.mongo` shell: +To use the :method:`rs.syncFrom()` helper in :mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/tutorial/configure-replica-set-tag-sets.txt b/source/tutorial/configure-replica-set-tag-sets.txt index 8e4ee9de0c0..4b3e5c584e4 100644 --- a/source/tutorial/configure-replica-set-tag-sets.txt +++ b/source/tutorial/configure-replica-set-tag-sets.txt @@ -71,7 +71,7 @@ have been omitted for brevity): #. **Add tags to the members.** - Connect a :binary:`~bin.mongo` shell to the replica set and use + Connect :mongosh:`mongosh ` to the replica set and use :method:`rs.reconfig()` to add tags to the members: .. code-block:: javascript @@ -198,7 +198,7 @@ Given a five member replica set with members in two data centers: #. **Add tags to the replica set members.** - Connect a :binary:`~bin.mongo` shell to the replica set and use + Connect :mongosh:`mongosh ` to the replica set and use :method:`rs.reconfig()` to add tags to the members: .. code-block:: javascript diff --git a/source/tutorial/configure-ssl-clients.txt b/source/tutorial/configure-ssl-clients.txt index 54b04a68ffe..8bff0618ffe 100644 --- a/source/tutorial/configure-ssl-clients.txt +++ b/source/tutorial/configure-ssl-clients.txt @@ -45,7 +45,7 @@ Clients must have support for TLS/SSL to connect to a procedures using their ``ssl`` aliases, see :ref:`mongo-shell-ssl-connect`. -The :binary:`~bin.mongo` shell provides various TLS/SSL settings, +:mongosh:`mongosh ` provides various TLS/SSL settings, including: .. list-table:: @@ -55,56 +55,56 @@ including: * - TLS Option (New in 4.2) - Notes - * - :option:`--tls ` + * - :option:`--tls ` - Enables TLS/SSL connection. - * - :option:`--tlsCertificateKeyFile ` + * - :option:`--tlsCertificateKeyFile ` - - Specifies the :file:`.pem` file that contains the - :binary:`~bin.mongo` shell's certificate and key to present to + - Specifies the :file:`.pem` file that contains + :mongosh:`mongosh `'s certificate and key to present to the :binary:`~bin.mongod` or :binary:`~bin.mongos` instance. This option is mutually exclusive with - :option:`--tlsCertificateSelector ` + :option:`--tlsCertificateSelector ` .. include:: /includes/extracts/4.4-changes-certificate-expiry-warning.rst - * - :option:`--tlsCertificateKeyFilePassword ` + * - :option:`--tlsCertificateKeyFilePassword ` - - If the :binary:`~bin.mongo` shell's certificate key file is encrypted. + - If :mongosh:`mongosh `'s certificate key file is encrypted. - * - :option:`--tlsCAFile ` + * - :option:`--tlsCAFile ` - Specifies the Certificate Authority (CA) :file:`.pem` file for verification of the certificate presented by the :binary:`~bin.mongod` or the :binary:`~bin.mongos` instance. - * - :option:`--tlsCertificateSelector ` + * - :option:`--tlsCertificateSelector ` - If running on Windows or macOS, use a certificate from the system certificate store. (*New in version 4.0*) This option is mutually exclusive with - :option:`--tlsCertificateKeyFile `. + :option:`--tlsCertificateKeyFile `. .. include:: /includes/extracts/4.4-changes-certificate-expiry-warning.rst -For a complete list of the :binary:`~bin.mongo` shell's ``tls`` +For a complete list of :mongosh:`mongosh `'s ``tls`` options, see :ref:`mongo-shell-tls`. -For TLS/SSL connections, the :binary:`~bin.mongo` shell validates the +For TLS/SSL connections, :mongosh:`mongosh ` validates the certificate presented by the :binary:`~bin.mongod` or :binary:`~bin.mongos` instance: -- The :binary:`~bin.mongo` shell verifies that the certificate is from - the specified Certificate Authority (:option:`--tlsCAFile `. If the certificate is not from the specified CA, the - :binary:`~bin.mongo` shell will fail to connect. +- :mongosh:`mongosh ` verifies that the certificate is from + the specified Certificate Authority (:option:`--tlsCAFile `. If the certificate is not from the specified CA, + :mongosh:`mongosh ` will fail to connect. - .. include:: /includes/extracts/ssl-facts-mongo-ssl-hostname-verification.rst - To connect a :binary:`~bin.mongo` shell to a :binary:`~bin.mongod` or + To connect :mongosh:`mongosh ` to a :binary:`~bin.mongod` or :binary:`~bin.mongos` that requires TLS/SSL, specify the - :option:`--host ` option or use a :doc:`connection + :option:`--host ` option or use a :doc:`connection string ` to specify the hostname. All other ``TLS/SSL`` options must be specified using the command-line options. @@ -122,11 +122,11 @@ Connect to MongoDB Instance Using Encryption (``tls`` Options) To connect to a :binary:`~bin.mongod` or :binary:`~bin.mongos` instance that requires :ref:`encrypted communication `, -start the :binary:`~bin.mongo` shell with: +start :mongosh:`mongosh ` with: -- :option:`--tls ` +- :option:`--tls ` -- :option:`--host ` and :option:`--tlsCAFile ` and :option:`--tlsCAFile ` to validate the server certificate. For example, consider a :binary:`~bin.mongod` instance running on @@ -136,14 +136,14 @@ For example, consider a :binary:`~bin.mongod` instance running on mongod --tlsMode requireTLS --tlsCertificateKeyFile -To connect to the instance, start a :binary:`~bin.mongo` shell with +To connect to the instance, start :mongosh:`mongosh ` with the following options: .. code-block:: bash mongo --tls --host hostname.example.com --tlsCAFile /etc/ssl/caToValidateServerCertificates.pem -The :binary:`~bin.mongo` shell verifies the certificate presented by +:mongosh:`mongosh ` verifies the certificate presented by the :binary:`~bin.mongod` instance against the specified hostname and the CA file. @@ -160,15 +160,14 @@ Connect to MongoDB Instance that Requires Client Certificates (``tls`` Options) To connect to a :binary:`~bin.mongod` or :binary:`~bin.mongos` that requires :ref:`CA-signed client certificates -`, start the :binary:`~bin.mongo` -shell with: +`, start :mongosh:`mongosh ` with: -- :option:`--tls ` +- :option:`--tls ` -- :option:`--host ` and the :option:`--tlsCAFile ` and the :option:`--tlsCAFile ` to validate the server certificate, -- :option:`--tlsCertificateKeyFile ` option to specify +- :option:`--tlsCertificateKeyFile ` option to specify the client certificate to present to the server. For example, consider a :binary:`~bin.mongod` instance running on @@ -178,7 +177,7 @@ For example, consider a :binary:`~bin.mongod` instance running on mongod --tlsMode requireTLS --tlsCertificateKeyFile /etc/ssl/mongodb.pem --tlsCAFile /etc/ssl/caToValidateClientCertificates.pem -To connect to the instance, start a :binary:`~bin.mongo` shell with the +To connect to the instance, start :mongosh:`mongosh ` with the following options: .. code-block:: bash @@ -186,25 +185,25 @@ following options: mongo --tls --host hostname.example.com --tlsCertificateKeyFile /etc/ssl/client.pem --tlsCAFile /etc/ssl/caToValidateServerCertificates.pem On Windows and macOS, - You can also use the :option:`--tlsCertificateSelector ` option to specify the client certificate from the system certificate store instead of using - :option:`--tlsCertificateKeyFile `. If the CA file is also in the system - certificate store, you can omit the :option:`--tlsCAFile ` option as well. For example, to use a certificate with the ``CN`` (Common Name) of ``myclient.example.net`` and the CA - file from the system certificate store on macOS, start a - :binary:`~bin.mongo` shell with the following options: + file from the system certificate store on macOS, start + :mongosh:`mongosh ` with the following options: .. code-block:: bash mongo --tls --host hostname.example.com --tlsCertificateSelector subject="myclient.example.net" - Although still available, the :binary:`~bin.mongo` shell - :option:`--ssl `, :option:`--sslCAFile `, :option:`--sslPEMKeyFile `, - :option:`--sslCertificateSelector ` + Although still available, :mongosh:`mongosh ` + :option:`--ssl `, :option:`--sslCAFile `, :option:`--sslPEMKeyFile `, + :option:`--sslCertificateSelector ` are :ref:`deprecated as of MongoDB 4.2 <4.2-tls>`. Avoid Use of ``--tlsAllowInvalidCertificates`` Option @@ -213,29 +212,29 @@ Avoid Use of ``--tlsAllowInvalidCertificates`` Option .. warning:: Although available, avoid using the - :option:`--tlsAllowInvalidCertificates ` option if possible. If the use of - :option:`--tlsAllowInvalidCertificates ` is necessary, only use the option on systems where intrusion is not possible. - If the :binary:`~bin.mongo` shell runs with the - :option:`--tlsAllowInvalidCertificates ` option, the :binary:`~bin.mongo` - shell will not attempt to validate the server certificates. This + If :mongosh:`mongosh ` runs with the + :option:`--tlsAllowInvalidCertificates ` option, :mongosh:`mongosh ` + will not attempt to validate the server certificates. This creates a vulnerability to expired :binary:`~bin.mongod` and :binary:`~bin.mongos` certificates as well as to foreign processes posing as valid :binary:`~bin.mongod` or :binary:`~bin.mongos` instances. If you only need to disable the validation of the hostname in the TLS/SSL certificates, see - :option:`--tlsAllowInvalidHostnames `. + :option:`--tlsAllowInvalidHostnames `. .. _mongo-shell-ssl-connect: ``mongo`` Shell Configuration (Using ``ssl`` Options) ------------------------------------------------------ -The :binary:`~bin.mongo` shell provides various TLS/SSL settings, +:mongosh:`mongosh ` provides various TLS/SSL settings, including: .. list-table:: @@ -245,47 +244,47 @@ including: * - SSL Option (Deprecated in 4.2) - Notes - * - :option:`--ssl ` + * - :option:`--ssl ` - Enables TLS/SSL connection. - * - :option:`--sslPEMKeyFile ` + * - :option:`--sslPEMKeyFile ` - - Specifies the :file:`.pem` file that contains the - :binary:`~bin.mongo` shell's certificate and key to present to + - Specifies the :file:`.pem` file that contains + :mongosh:`mongosh `'s certificate and key to present to the :binary:`~bin.mongod` or :binary:`~bin.mongos` instance. - * - :option:`--sslPEMKeyPassword ` + * - :option:`--sslPEMKeyPassword ` - - If the :binary:`~bin.mongo` shell's certificate key file is encrypted. + - If :mongosh:`mongosh `'s certificate key file is encrypted. - * - :option:`--sslCAFile ` + * - :option:`--sslCAFile ` - Specifies the Certificate Authority (CA) :file:`.pem` file for verification of the certificate presented by the :binary:`~bin.mongod` or the :binary:`~bin.mongos` instance. - * - :option:`--sslCertificateSelector ` + * - :option:`--sslCertificateSelector ` - If running on Windows or macOS, use a certificate from the system certificate store. (*New in version 4.0*) -For a complete list of the :binary:`~bin.mongo` shell's ``ssl`` +For a complete list of :mongosh:`mongosh `'s ``ssl`` options, see :ref:`SSL Options `. -For TLS/SSL connections, the :binary:`~bin.mongo` shell validates the +For TLS/SSL connections, :mongosh:`mongosh ` validates the certificate presented by the :binary:`~bin.mongod` or :binary:`~bin.mongos` instance: -- The :binary:`~bin.mongo` shell verifies that the certificate is from - the specified Certificate Authority :option:`--sslCAFile `. If the certificate is not from the specified CA, the - :binary:`~bin.mongo` shell will fail to connect. +- :mongosh:`mongosh ` verifies that the certificate is from + the specified Certificate Authority :option:`--sslCAFile `. If the certificate is not from the specified CA, + :mongosh:`mongosh ` will fail to connect. - .. include:: /includes/extracts/ssl-facts-mongo-ssl-hostname-verification.rst - To connect a :binary:`~bin.mongo` shell to a :binary:`~bin.mongod` or + To connect :mongosh:`mongosh ` to a :binary:`~bin.mongod` or :binary:`~bin.mongos` that requires TLS/SSL, specify the - :option:`--host ` option or use a :doc:`connection + :option:`--host ` option or use a :doc:`connection string ` to specify the hostname. All other ``TLS/SSL`` options must be specified using the command-line options. @@ -303,11 +302,11 @@ Connect to MongoDB Instance Using Encryption (``--ssl`` Options) To connect to a :binary:`~bin.mongod` or :binary:`~bin.mongos` instance that requires :ref:`encrypted communication `, -start the :binary:`~bin.mongo` shell with: +start :mongosh:`mongosh ` with: -- :option:`--ssl ` +- :option:`--ssl ` -- :option:`--host ` and :option:`--sslCAFile ` and :option:`--sslCAFile ` to validate the server certificate. For example, consider a :binary:`~bin.mongod` instance running on @@ -317,14 +316,14 @@ For example, consider a :binary:`~bin.mongod` instance running on mongod --sslMode requireSSL --sslPEMKeyFile -To connect to the instance, start a :binary:`~bin.mongo` shell with the +To connect to the instance, start :mongosh:`mongosh ` with the following options: .. code-block:: bash mongo --ssl --host hostname.example.com --sslCAFile /etc/ssl/caToValidateServerCertificates.pem -The :binary:`~bin.mongo` shell verifies the certificate presented by +:mongosh:`mongosh ` verifies the certificate presented by the :binary:`~bin.mongod` instance against the specified hostname and the CA file. @@ -341,15 +340,14 @@ Connect to MongoDB Instance that Requires Client Certificates (``ssl`` Options) To connect to a :binary:`~bin.mongod` or :binary:`~bin.mongos` that requires :ref:`CA-signed client certificates -`, start the :binary:`~bin.mongo` -shell with: +`, start :mongosh:`mongosh ` with: -- :option:`--ssl ` +- :option:`--ssl ` -- :option:`--host ` and the :option:`--sslCAFile ` and the :option:`--sslCAFile ` to validate the server certificate, -- :option:`--sslPEMKeyFile ` option to specify +- :option:`--sslPEMKeyFile ` option to specify the client certificate to present to the server. For example, consider a :binary:`~bin.mongod` instance running on @@ -359,7 +357,7 @@ For example, consider a :binary:`~bin.mongod` instance running on mongod --sslMode requireSSL --sslPEMKeyFile /etc/ssl/mongodb.pem --sslCAFile /etc/ssl/ca.pem -To connect to the instance, start a :binary:`~bin.mongo` shell with the +To connect to the instance, start :mongosh:`mongosh ` with the following options: .. code-block:: bash @@ -367,16 +365,16 @@ following options: mongo --ssl --host hostname.example.com --sslPEMKeyFile /etc/ssl/client.pem --sslCAFile /etc/ssl/ca.pem On Windows and macOS, - You can also use the :option:`--sslCertificateSelector ` option to specify the client certificate from the system certificate store instead of using - :option:`--sslPEMKeyFile `. If the CA file + :option:`--sslPEMKeyFile `. If the CA file is also in the system certificate store, you can omit the - :option:`--sslCAFile ` option as well. For + :option:`--sslCAFile ` option as well. For example, to use a certificate with the ``CN`` (Common Name) of ``myclient.example.net`` and the CA file from the system certificate - store on macOS, start a :binary:`~bin.mongo` shell with the - following options: + store on macOS, start :mongosh:`mongosh ` with the following + options: .. code-block:: bash @@ -440,7 +438,7 @@ tools include: - :binary:`~bin.mongotop` To use encrypted communication with these tools, use the same ``ssl`` options as -the :binary:`~bin.mongo` shell. See :ref:`mongo-shell-ssl-connect`. +:mongosh:`mongosh `. See :ref:`mongo-shell-ssl-connect`. .. seealso:: diff --git a/source/tutorial/configure-x509-client-authentication.txt b/source/tutorial/configure-x509-client-authentication.txt index 0cf996f4454..411c386fa44 100644 --- a/source/tutorial/configure-x509-client-authentication.txt +++ b/source/tutorial/configure-x509-client-authentication.txt @@ -355,23 +355,23 @@ authenticate with the client certificate. * - Option - Notes - * - :option:`--tls ` + * - :option:`--tls ` - - * - :option:`--tlsCertificateKeyFile ` + * - :option:`--tlsCertificateKeyFile ` - Client's x.509 file. - * - :option:`--tlsCAFile ` + * - :option:`--tlsCAFile ` - Certificate Authority file to verify the certificate presented by the :binary:`~bin.mongod` instance. - * - :option:`--authenticationDatabase ` + * - :option:`--authenticationDatabase ` - Specify ``'$external'``. - * - :option:`--authenticationMechanism ` + * - :option:`--authenticationMechanism ` - Specify ``MONGODB-X509``. - id: authafter @@ -382,9 +382,9 @@ authenticate with the client certificate. :method:`db.auth()` method to authenticate after connection. - For example, if using the :binary:`~bin.mongo` shell, + For example, if using :mongosh:`mongosh `, - 1. Connect :binary:`~bin.mongo` shell to the :binary:`~bin.mongod` set up for + 1. Connect :mongosh:`mongosh ` to the :binary:`~bin.mongod` set up for TLS/SSL: .. code-block:: bash @@ -398,13 +398,13 @@ authenticate with the client certificate. * - Option - Notes - * - :option:`--tls ` + * - :option:`--tls ` - - * - :option:`--tlsCertificateKeyFile ` + * - :option:`--tlsCertificateKeyFile ` - Client's x.509 file. - * - :option:`--tlsCAFile ` + * - :option:`--tlsCAFile ` - Certificate Authority file to verify the certificate presented by @@ -463,23 +463,23 @@ authenticate with the client certificate. * - Option - Notes - * - :option:`--ssl ` + * - :option:`--ssl ` - - * - :option:`--sslPEMKeyFile ` + * - :option:`--sslPEMKeyFile ` - Client's x.509 file. - * - :option:`--sslCAFile ` + * - :option:`--sslCAFile ` - Certificate Authority file to verify the certificate presented by :binary:`~bin.mongod`/:binary:`~bin.mongos` instance. - * - :option:`--authenticationDatabase ` + * - :option:`--authenticationDatabase ` - Specify ``'$external'``. - * - :option:`--authenticationMechanism ` + * - :option:`--authenticationMechanism ` - Specify ``MONGODB-X509``. - id: authafter @@ -490,9 +490,9 @@ authenticate with the client certificate. :method:`db.auth()` method to authenticate after connection. - For example, if using the :binary:`~bin.mongo` shell, + For example, if using :mongosh:`mongosh `, - 1. Connect :binary:`~bin.mongo` shell to the :binary:`~bin.mongod` set up for + 1. Connect :mongosh:`mongosh ` to the :binary:`~bin.mongod` set up for TLS/SSL: .. code-block:: bash @@ -506,13 +506,13 @@ authenticate with the client certificate. * - Option - Notes - * - :option:`--ssl ` + * - :option:`--ssl ` - - * - :option:`--sslPEMKeyFile ` + * - :option:`--sslPEMKeyFile ` - Client's x.509 file. - * - :option:`--sslCAFile ` + * - :option:`--sslCAFile ` - Certificate Authority file to verify the certificate presented by diff --git a/source/tutorial/control-access-to-mongodb-with-kerberos-authentication.txt b/source/tutorial/control-access-to-mongodb-with-kerberos-authentication.txt index fee602308c4..259aab01401 100644 --- a/source/tutorial/control-access-to-mongodb-with-kerberos-authentication.txt +++ b/source/tutorial/control-access-to-mongodb-with-kerberos-authentication.txt @@ -64,7 +64,7 @@ Procedure The following procedure outlines the steps to add a Kerberos user principal to MongoDB, configure a standalone :binary:`~bin.mongod` instance -for Kerberos support, and connect using the :binary:`~bin.mongo` shell and +for Kerberos support, and connect using :mongosh:`mongosh ` and authenticate the user principal. .. include:: /includes/steps/control-access-to-mongodb-with-kerberos-authentication.rst diff --git a/source/tutorial/convert-secondary-into-arbiter.txt b/source/tutorial/convert-secondary-into-arbiter.txt index 724710e2d33..e590478d72f 100644 --- a/source/tutorial/convert-secondary-into-arbiter.txt +++ b/source/tutorial/convert-secondary-into-arbiter.txt @@ -46,14 +46,14 @@ Convert Secondary to Arbiter and Reuse the Port Number #. Remove the :term:`secondary` from the :term:`replica set` by calling the :method:`rs.remove()` method. Perform this operation while connected to the current - :term:`primary` in the :binary:`~bin.mongo` shell: + :term:`primary` in :mongosh:`mongosh `: .. code-block:: javascript rs.remove("<:port>") #. Verify that the replica set no longer includes the secondary by - calling the :method:`rs.conf()` method in the :binary:`~bin.mongo` shell: + calling the :method:`rs.conf()` method in :mongosh:`mongosh `: .. code-block:: javascript @@ -88,7 +88,7 @@ Convert Secondary to Arbiter and Reuse the Port Number mongod --port 27021 --dbpath /data/db --replSet rs --bind_ip localhost, -#. In the :binary:`~bin.mongo` shell convert the secondary to an arbiter +#. In :mongosh:`mongosh ` convert the secondary to an arbiter using the :method:`rs.addArb()` method: .. code-block:: javascript @@ -96,7 +96,7 @@ Convert Secondary to Arbiter and Reuse the Port Number rs.addArb("<:port>") #. Verify the arbiter belongs to the replica set by calling the - :method:`rs.conf()` method in the :binary:`~bin.mongo` shell. + :method:`rs.conf()` method in :mongosh:`mongosh `. .. code-block:: javascript @@ -135,7 +135,7 @@ Convert Secondary to Arbiter Running on a New Port Number mongod --port 27021 --dbpath /data/db-temp --replSet rs --bind_ip localhost, -#. In the :binary:`~bin.mongo` shell connected to the current primary, +#. In :mongosh:`mongosh ` connected to the current primary, convert the new :binary:`~bin.mongod` instance to an arbiter using the :method:`rs.addArb()` method: @@ -144,7 +144,7 @@ Convert Secondary to Arbiter Running on a New Port Number rs.addArb("<:port>") #. Verify the arbiter has been added to the replica set by calling the - :method:`rs.conf()` method in the :binary:`~bin.mongo` shell. + :method:`rs.conf()` method in :mongosh:`mongosh `. .. code-block:: javascript @@ -159,14 +159,14 @@ Convert Secondary to Arbiter Running on a New Port Number #. Shut down the secondary. #. Remove the :term:`secondary` from the :term:`replica set` by calling - the :method:`rs.remove()` method in the :binary:`~bin.mongo` shell: + the :method:`rs.remove()` method in :mongosh:`mongosh `: .. code-block:: javascript rs.remove("<:port>") #. Verify that the replica set no longer includes the old secondary by - calling the :method:`rs.conf()` method in the :binary:`~bin.mongo` shell: + calling the :method:`rs.conf()` method in :mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/tutorial/convert-shard-standalone-to-shard-replica-set.txt b/source/tutorial/convert-shard-standalone-to-shard-replica-set.txt index b1485daece5..097d4bb3dcb 100644 --- a/source/tutorial/convert-shard-standalone-to-shard-replica-set.txt +++ b/source/tutorial/convert-shard-standalone-to-shard-replica-set.txt @@ -50,7 +50,7 @@ Procedure :doc:`/reference/configuration-options` and the :binary:`~bin.mongod` manual page. -#. Connect a :binary:`~bin.mongo` shell to the shard :binary:`~bin.mongod` instance. +#. Connect :mongosh:`mongosh ` to the shard :binary:`~bin.mongod` instance. #. Use :method:`rs.initiate()` to initiate the new replica set: @@ -64,7 +64,7 @@ Procedure #. Disconnect from the instance. -#. Connect a :binary:`~bin.mongo` shell to one of the sharded cluster's +#. Connect :mongosh:`mongosh ` to one of the sharded cluster's :binary:`~bin.mongos` instances and retrieve the shard information: .. code-block:: javascript diff --git a/source/tutorial/convert-standalone-to-replica-set.txt b/source/tutorial/convert-standalone-to-replica-set.txt index 395f89d3506..d9e5c83fa73 100644 --- a/source/tutorial/convert-standalone-to-replica-set.txt +++ b/source/tutorial/convert-standalone-to-replica-set.txt @@ -48,7 +48,7 @@ Procedure :doc:`/reference/configuration-options` and the :binary:`~bin.mongod` manual page. -#. Connect a :binary:`~bin.mongo` shell to the :binary:`~bin.mongod` instance. +#. Connect :mongosh:`mongosh ` to the :binary:`~bin.mongod` instance. #. Use :method:`rs.initiate()` to initiate the new replica set: diff --git a/source/tutorial/create-chunks-in-sharded-cluster.txt b/source/tutorial/create-chunks-in-sharded-cluster.txt index 45a784b6125..881aa566322 100644 --- a/source/tutorial/create-chunks-in-sharded-cluster.txt +++ b/source/tutorial/create-chunks-in-sharded-cluster.txt @@ -42,7 +42,7 @@ To split empty chunks manually, you can run the :dbcommand:`split` command: To create chunks for documents in the ``myapp.users`` collection using the ``email`` field as the :term:`shard key`, - use the following operation in the :binary:`~bin.mongo` shell: + use the following operation in :mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/tutorial/deploy-replica-set-for-testing.txt b/source/tutorial/deploy-replica-set-for-testing.txt index 3b4414aea7b..ed53d635158 100644 --- a/source/tutorial/deploy-replica-set-for-testing.txt +++ b/source/tutorial/deploy-replica-set-for-testing.txt @@ -104,8 +104,8 @@ Procedure overloading your machine. For more information on this and other configuration options, see :doc:`/reference/configuration-options`. -#. Connect to one of your :binary:`~bin.mongod` instances through the - :binary:`~bin.mongo` shell. You will need to indicate which instance by +#. Connect to one of your :binary:`~bin.mongod` instances through + :mongosh:`mongosh `. You will need to indicate which instance by specifying its port number. For the sake of simplicity and clarity, you may want to choose the first one, as in the following command; @@ -113,9 +113,9 @@ Procedure mongo --port 27017 -#. In the :binary:`~bin.mongo` shell, use :method:`rs.initiate()` to +#. In :mongosh:`mongosh `, use :method:`rs.initiate()` to initiate the replica set. You can create a replica set - configuration object in the :binary:`~bin.mongo` shell environment, as + configuration object in :mongosh:`mongosh ` environment, as in the following example: .. code-block:: javascript diff --git a/source/tutorial/deploy-replica-set-with-keyfile-access-control.txt b/source/tutorial/deploy-replica-set-with-keyfile-access-control.txt index 5b71a34bb38..4ed59d3f608 100644 --- a/source/tutorial/deploy-replica-set-with-keyfile-access-control.txt +++ b/source/tutorial/deploy-replica-set-with-keyfile-access-control.txt @@ -28,7 +28,7 @@ For this tutorial, each member of the replica set uses the same internal authentication mechanism and settings. Enforcing internal authentication also enforces user access control. To -connect to the replica set, clients like the :binary:`~bin.mongo` shell need to +connect to the replica set, clients like :mongosh:`mongosh ` need to use a :doc:`user account`. See :ref:`security-repSetDeploy-access-control`. diff --git a/source/tutorial/deploy-shard-cluster.txt b/source/tutorial/deploy-shard-cluster.txt index 7fe1c4b43d5..ad332f77ab5 100644 --- a/source/tutorial/deploy-shard-cluster.txt +++ b/source/tutorial/deploy-shard-cluster.txt @@ -174,19 +174,19 @@ command line parameter to specify the config servers. At this point, your sharded cluster consists of the :binary:`~bin.mongos` and the config servers. You can now connect to -the sharded cluster using the :binary:`~bin.mongo` shell. +the sharded cluster using :mongosh:`mongosh `. Connect to the Sharded Cluster ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Connect a :binary:`~bin.mongo` shell to the :binary:`~bin.mongos`. +Connect :mongosh:`mongosh ` to the :binary:`~bin.mongos`. Specify the ``host`` and ``port`` on which the ``mongos`` is running: .. code-block:: bash mongo --host --port -Once you have connected the :binary:`~bin.mongo` shell to the +Once you have connected :mongosh:`mongosh ` to the :binary:`~bin.mongos`, continue to the next procedure to add shards to the cluster. @@ -195,7 +195,7 @@ the cluster. Add Shards to the Cluster ~~~~~~~~~~~~~~~~~~~~~~~~~ -In the :binary:`~bin.mongo` shell connected to the +In a :mongosh:`mongosh ` session that is connected to the :binary:`~bin.mongos`, use the :method:`sh.addShard()` method to add each shard to the cluster. @@ -217,7 +217,7 @@ collection's database. Enabling sharding for a database does not redistribute data but make it possible to shard the collections in that database. -From the :binary:`~bin.mongo` shell connected to the +From a :mongosh:`mongosh ` session that is connected to the :binary:`~bin.mongos`, use the :method:`sh.enableSharding()` method to enable sharding on the target database. Enabling sharding on a database makes it possible to shard collections within a database. @@ -243,9 +243,8 @@ Shard a Collection :ref:`enable sharding ` for the database where the collection resides. -To shard a collection, connect to the :binary:`~bin.mongos` from the -:binary:`~bin.mongo` shell and use the :method:`sh.shardCollection()` -method. +To shard a collection, connect :mongosh:`mongosh ` to the +:binary:`~bin.mongos` and use the :method:`sh.shardCollection()` method. .. note:: Sharding and Indexes @@ -281,7 +280,7 @@ as well as your ability to take advantage of certain sharding features such as :ref:`zones `. To learn how to choose an effective shard key, see :ref:`sharding-shard-key-selection`. -Starting in version 4.0, the :binary:`~bin.mongo` shell +Starting in version 4.0, :mongosh:`mongosh ` provides the method :method:`convertShardKeyToHashed()`. This method uses the same hashing function as the hashed index and can be used to see what the hashed value would be for a key. diff --git a/source/tutorial/deploy-sharded-cluster-with-keyfile-access-control.txt b/source/tutorial/deploy-sharded-cluster-with-keyfile-access-control.txt index 6774a6e52b6..4f7ea67e304 100644 --- a/source/tutorial/deploy-sharded-cluster-with-keyfile-access-control.txt +++ b/source/tutorial/deploy-sharded-cluster-with-keyfile-access-control.txt @@ -29,7 +29,7 @@ The following tutorial uses a :ref:`keyfile ` to enable internal authentication. Enforcing internal authentication also enforces user access control. To -connect to the replica set, clients like the :binary:`~bin.mongo` shell need to +connect to the replica set, clients like :mongosh:`mongosh ` need to use a :doc:`user account`. See :ref:`security-shardClust-deploy-access-control`. diff --git a/source/tutorial/enforce-keyfile-access-control-in-existing-replica-set.txt b/source/tutorial/enforce-keyfile-access-control-in-existing-replica-set.txt index 104204f2798..2729756764d 100644 --- a/source/tutorial/enforce-keyfile-access-control-in-existing-replica-set.txt +++ b/source/tutorial/enforce-keyfile-access-control-in-existing-replica-set.txt @@ -26,7 +26,7 @@ For this tutorial, each member of the replica set uses the same internal authentication mechanism and settings. Enforcing internal authentication also enforces user access control. To -connect to the replica set, clients like the :binary:`~bin.mongo` shell need to +connect to the replica set, clients like :mongosh:`mongosh ` need to use a :doc:`user account`. See :ref:`security-replSet-auth-access-control`. diff --git a/source/tutorial/enforce-keyfile-access-control-in-existing-sharded-cluster.txt b/source/tutorial/enforce-keyfile-access-control-in-existing-sharded-cluster.txt index 08614d837b0..e855a5fcab1 100644 --- a/source/tutorial/enforce-keyfile-access-control-in-existing-sharded-cluster.txt +++ b/source/tutorial/enforce-keyfile-access-control-in-existing-sharded-cluster.txt @@ -29,7 +29,7 @@ The following tutorial uses a :ref:`keyfile ` to enable internal authentication. Enforcing internal authentication also enforces user access control. To -connect to the replica set, clients like the :binary:`~bin.mongo` shell need to +connect to the replica set, clients like :mongosh:`mongosh ` need to use a :doc:`user account`. See :ref:`security-shardClust-enforce-access-control`. diff --git a/source/tutorial/evaluate-operation-performance.txt b/source/tutorial/evaluate-operation-performance.txt index 78b2638b8a1..9396a4b2b2a 100644 --- a/source/tutorial/evaluate-operation-performance.txt +++ b/source/tutorial/evaluate-operation-performance.txt @@ -47,7 +47,7 @@ control the amount of information returned. .. example:: To use :method:`cursor.explain()` on a query for documents matching the expression ``{ a: 1 }``, in the collection named ``records``, use an operation that resembles the - following in the :binary:`~bin.mongo` shell: + following in :mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/tutorial/force-member-to-be-primary.txt b/source/tutorial/force-member-to-be-primary.txt index b74681c3272..ed163276856 100644 --- a/source/tutorial/force-member-to-be-primary.txt +++ b/source/tutorial/force-member-to-be-primary.txt @@ -75,8 +75,9 @@ This procedure assumes this configuration: ] } -1. In a :binary:`~bin.mongo` shell connected to the primary, use the - following sequence of operations to make ``m3.example.net`` the primary: +1. In a :mongosh:`mongosh ` session that is connected to the primary, + use the following sequence of operations to make ``m3.example.net`` + the primary: .. code-block:: javascript @@ -146,22 +147,22 @@ Consider a :term:`replica set` with the following members: To force a member to become primary use the following procedure: -1. In a :binary:`~bin.mongo` shell, run :method:`rs.status()` to ensure your replica - set is running as expected. +1. In :mongosh:`mongosh `, run :method:`rs.status()` to ensure your + replica set is running as expected. -#. In a :binary:`~bin.mongo` shell connected to the :binary:`~bin.mongod` - instance running on ``mdb2.example.net``, freeze - ``mdb2.example.net`` so that it does not attempt to become primary - for 120 seconds. +#. In a :mongosh:`mongosh ` session that is connected to the + :binary:`~bin.mongod` instance running on ``mdb2.example.net``, + freeze ``mdb2.example.net`` so that it does not attempt to become + primary for 120 seconds. .. code-block:: javascript rs.freeze(120) -#. In a :binary:`~bin.mongo` shell connected the :binary:`~bin.mongod` running - on ``mdb0.example.net``, step down this instance that the - :binary:`~bin.mongod` is not eligible to become primary for 120 - seconds: +#. In a :mongosh:`mongosh ` session that is connected to the + :binary:`~bin.mongod` running on ``mdb0.example.net``, step down this + instance that the :binary:`~bin.mongod` is not eligible to become + primary for 120 seconds: .. code-block:: javascript diff --git a/source/tutorial/geospatial-tutorial.txt b/source/tutorial/geospatial-tutorial.txt index d570ae3543a..72899b6fc98 100644 --- a/source/tutorial/geospatial-tutorial.txt +++ b/source/tutorial/geospatial-tutorial.txt @@ -74,7 +74,7 @@ always improves performance of :query:`$geoWithin` and :query:`$geoIntersects` queries. Because this data is geographical, create a ``2dsphere`` index on each -collection using the :binary:`~bin.mongo` shell: +collection using :mongosh:`mongosh `: .. code-block:: javascript @@ -84,8 +84,8 @@ collection using the :binary:`~bin.mongo` shell: Exploring the Data ~~~~~~~~~~~~~~~~~~ -Inspect an entry in the newly-created ``restaurants`` collection from within the -:binary:`~bin.mongo` shell: +Inspect an entry in the newly-created ``restaurants`` collection in +:mongosh:`mongosh `: .. code-block:: javascript @@ -178,7 +178,7 @@ Find all Restaurants in the Neighborhood ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can also query to find all restaurants contained in a given neighborhood. -Run the following in the :binary:`~bin.mongo` shell to find the neighborhood +Run the following in :mongosh:`mongosh ` to find the neighborhood containing the user, and then count the restaurants within that neighborhood: .. code-block:: javascript diff --git a/source/tutorial/install-mongodb-enterprise-on-windows.txt b/source/tutorial/install-mongodb-enterprise-on-windows.txt index ea03ea210f2..d134af91bee 100644 --- a/source/tutorial/install-mongodb-enterprise-on-windows.txt +++ b/source/tutorial/install-mongodb-enterprise-on-windows.txt @@ -144,8 +144,8 @@ Interpreter` with Administrative privileges and run: For more information on connecting a :binary:`mongo.exe ` shell, such as to connect to a MongoDB instance running on a different -host and/or port, see :doc:`/reference/mongo`. For information on CRUD -(Create,Read,Update,Delete) operations, see: +host and/or port, see the :mongosh:`mongosh documentation `. For +information on CRUD (Create,Read,Update,Delete) operations, see: - :doc:`/tutorial/insert-documents` - :doc:`/tutorial/query-documents` diff --git a/source/tutorial/install-mongodb-on-os-x.txt b/source/tutorial/install-mongodb-on-os-x.txt index f1ab50cf0d7..12910acfd44 100644 --- a/source/tutorial/install-mongodb-on-os-x.txt +++ b/source/tutorial/install-mongodb-on-os-x.txt @@ -130,7 +130,7 @@ The installation includes the following binaries: - The :binary:`~bin.mongod` server - The :binary:`~bin.mongos` sharded cluster query router -- The :binary:`~bin.mongo` shell +- :mongosh:`mongosh ` In addition, the installation creates the following files and directories at the location specified below, depending on your Apple @@ -251,7 +251,7 @@ You can also view the log file to see the current status of your Connect and Use MongoDB ~~~~~~~~~~~~~~~~~~~~~~~ -To begin using MongoDB, connect a :binary:`~bin.mongo` shell to the +To begin using MongoDB, connect :mongosh:`mongosh ` to the running instance. From a new terminal, issue the following: .. code-block:: bash diff --git a/source/tutorial/install-mongodb-on-windows.txt b/source/tutorial/install-mongodb-on-windows.txt index 000d44723f0..ae2a343c8c6 100644 --- a/source/tutorial/install-mongodb-on-windows.txt +++ b/source/tutorial/install-mongodb-on-windows.txt @@ -133,8 +133,8 @@ Interpreter` with Administrative privileges and run: For more information on connecting a :binary:`mongo.exe ` shell, such as to connect to a MongoDB instance running on a different -host and/or port, see :doc:`/reference/mongo`. For information on CRUD -(Create,Read,Update,Delete) operations, see: +host and/or port, see the :mongosh:`mongosh documentation `. For +information on CRUD (Create,Read,Update,Delete) operations, see: - :doc:`/tutorial/insert-documents` - :doc:`/tutorial/query-documents` diff --git a/source/tutorial/iterate-a-cursor.txt b/source/tutorial/iterate-a-cursor.txt index 666bec9deb8..e48b6159116 100644 --- a/source/tutorial/iterate-a-cursor.txt +++ b/source/tutorial/iterate-a-cursor.txt @@ -13,8 +13,8 @@ Iterate a Cursor in the ``mongo`` Shell :class: singlecol The :method:`db.collection.find()` method returns a cursor. To access -the documents, you need to iterate the cursor. However, in the -:binary:`~bin.mongo` shell, if the returned cursor is not assigned to a +the documents, you need to iterate the cursor. However, in +:mongosh:`mongosh `, if the returned cursor is not assigned to a variable using the ``var`` keyword, then the cursor is automatically iterated up to 20 times [#set-shell-batch-size]_ to print up to the first 20 documents in the results. @@ -25,7 +25,7 @@ access the documents or to use the iterator index. Manually Iterate the Cursor --------------------------- -In the :binary:`~bin.mongo` shell, when you assign the cursor returned from +In :mongosh:`mongosh `, when you assign the cursor returned from the :method:`find() ` method to a variable using the ``var`` keyword, the cursor does not automatically iterate. @@ -80,7 +80,7 @@ information on cursor methods. Iterator Index -------------- -In the :binary:`~bin.mongo` shell, you can use the +In :mongosh:`mongosh `, you can use the :method:`~cursor.toArray()` method to iterate the cursor and return the documents in an array, as in the following: @@ -123,7 +123,7 @@ Closure of Inactive Cursors By default, the server will automatically close the cursor after 10 minutes of inactivity, or if client has exhausted the cursor. To -override this behavior in the :binary:`~bin.mongo` shell, you can use +override this behavior in :mongosh:`mongosh `, you can use the :method:`cursor.noCursorTimeout()` method: .. code-block:: javascript diff --git a/source/tutorial/manage-client-side-encryption-data-keys.txt b/source/tutorial/manage-client-side-encryption-data-keys.txt index b072f73e4c4..897573aab35 100644 --- a/source/tutorial/manage-client-side-encryption-data-keys.txt +++ b/source/tutorial/manage-client-side-encryption-data-keys.txt @@ -13,12 +13,12 @@ Manage Data Encryption Keys .. versionadded:: 4.2 Client-side field level encryption uses data encryption keys for -encryption and decryption. The :binary:`~bin.mongo` shell -:method:`getKeyVault()` method returns a key vault object for creating, +encryption and decryption. The :mongosh:`mongosh ` helper method +:method:`getKeyVault()` returns a key vault object for creating, modifying, and deleting data encryption keys. -This page documents client-side field level encryption using the -:binary:`~bin.mongo` shell, and does *not* refer to any official MongoDB +This page documents client-side field level encryption using +:mongosh:`mongosh `, and does *not* refer to any official MongoDB 4.2+ compatible driver. See the relevant :ref:`documentation ` for driver-specific data encryption key management methods and syntax. @@ -28,7 +28,7 @@ key management methods and syntax. Create a Data Encryption Key ---------------------------- -The following procedure uses the :binary:`~bin.mongo` shell to create a +The following procedure uses :mongosh:`mongosh ` to create a data encryption key for use with client-side field level encryption and decryption. For guidance on data encryption key management using a 4.2+ compatible driver, see the `driver documentation @@ -64,14 +64,14 @@ appropriate for your deployment: Manage a Data Encryption Key's Alternate Name --------------------------------------------- -The following procedure uses the :binary:`~bin.mongo` shell to manage +The following procedure uses :mongosh:`mongosh ` to manage the alternate names of a data encryption key. For guidance on data encryption key management using a 4.2+ compatible driver, see the `driver documentation `__ instead. -If you are still within your configured :binary:`~bin.mongo` shell -session from the :ref:`field-level-encryption-data-key-create` steps -above, you can skip directly to step 5. +If you are still within your configured :mongosh:`mongosh ` session +from the :ref:`field-level-encryption-data-key-create` steps above, you +can skip directly to step 5. Use the tabs below to select the :abbr:`KMS (Key Management Service)` appropriate for your deployment: @@ -108,14 +108,14 @@ Remove a Data Encryption Key Deleting a data encryption key renders all fields encrypted using that key as permanently unreadable. -The following procedure uses the :binary:`~bin.mongo` shell to remove a +The following procedure uses :mongosh:`mongosh ` to remove a data encryption key from the key vault. For guidance on data encryption key management using a 4.2+ compatible driver, see the `driver documentation `__ instead. -If you are still within your configured :binary:`~bin.mongo` shell -session from the :ref:`field-level-encryption-data-key-create` steps -above, you can skip directly to step 5. +If you are still within your configured :mongosh:`mongosh ` session +from the :ref:`field-level-encryption-data-key-create` steps above, you +can skip directly to step 5. Use the tabs below to select the :abbr:`KMS (Key Management Service)` appropriate for your deployment: @@ -163,9 +163,8 @@ driver in order to configure `, you must use the ``base64`` representation of the UUID string. -You can run the following operation in the :binary:`~bin.mongo` -shell to convert a ``UUID`` hexadecimal string to its ``base64`` -representation: +You can run the following operation in :mongosh:`mongosh ` to convert +a ``UUID`` hexadecimal string to its ``base64`` representation: .. code-block:: javascript diff --git a/source/tutorial/manage-journaling.txt b/source/tutorial/manage-journaling.txt index 223e20c7d25..9659d7eca1e 100644 --- a/source/tutorial/manage-journaling.txt +++ b/source/tutorial/manage-journaling.txt @@ -111,9 +111,8 @@ instance: the restart below. #. Perform a clean shutdown of the :binary:`~bin.mongod` - instance. For example, connect a :binary:`~bin.mongo` - shell to the instance and issue - :method:`db.shutdownServer()`: + instance. For example, connect :mongosh:`mongosh ` to + the instance and issue :method:`db.shutdownServer()`: .. code-block:: javascript @@ -150,9 +149,8 @@ instance: standalone without the journal. #. Perform a clean shutdown of the :binary:`~bin.mongod` - instance. For example, connect a :binary:`~bin.mongo` - shell to the instance and issue - :method:`db.shutdownServer()`: + instance. For example, connect :mongosh:`mongosh ` to + the instance and issue :method:`db.shutdownServer()`: .. code-block:: javascript @@ -294,9 +292,8 @@ instance: standalone without the journal. #. Perform a clean shutdown of the :binary:`~bin.mongod` - instance. For example, connect a :binary:`~bin.mongo` - shell to the instance and issue - :method:`db.shutdownServer()`: + instance. For example, connect :mongosh:`mongosh ` to + the instance and issue :method:`db.shutdownServer()`: .. code-block:: javascript diff --git a/source/tutorial/manage-mongodb-processes.txt b/source/tutorial/manage-mongodb-processes.txt index 37fc0736bff..d3f7c37d3b4 100644 --- a/source/tutorial/manage-mongodb-processes.txt +++ b/source/tutorial/manage-mongodb-processes.txt @@ -22,7 +22,7 @@ The following examples assume the directory containing the :binary:`~bin.mongod` process is the primary database process that runs on an individual server. :binary:`~bin.mongos` provides a coherent MongoDB interface equivalent to a :binary:`~bin.mongod` from the perspective of a -client. The :binary:`~bin.mongo` binary provides the administrative +client. The :mongosh:`mongosh ` binary provides the administrative shell. This document discusses the :binary:`~bin.mongod` process; however, @@ -132,7 +132,7 @@ instances using one of the following methods: Use ``shutdownServer()`` ~~~~~~~~~~~~~~~~~~~~~~~~ -Shut down the :binary:`~bin.mongod` from the :binary:`~bin.mongo` shell using +Shut down the :binary:`~bin.mongod` from :mongosh:`mongosh ` using the :method:`db.shutdownServer()` method as follows: .. code-block:: javascript @@ -253,7 +253,7 @@ Force Replica Set Shutdown If there is no up-to-date secondary and you want the primary to shut down, issue the :dbcommand:`shutdown` command with the ``force`` -argument, as in the following :binary:`~bin.mongo` shell operation: +argument, as in the following :mongosh:`mongosh ` operation: .. code-block:: javascript diff --git a/source/tutorial/manage-sharded-cluster-balancer.txt b/source/tutorial/manage-sharded-cluster-balancer.txt index 613d8857690..79a816e6880 100644 --- a/source/tutorial/manage-sharded-cluster-balancer.txt +++ b/source/tutorial/manage-sharded-cluster-balancer.txt @@ -23,13 +23,6 @@ to balancing. For an introduction to balancing, see :ref:`sharding-balancing`. For lower level information on balancing, see :ref:`sharding-balancing-internals`. -.. important:: - - Use the version of the :binary:`~bin.mongo` shell that corresponds to - the version of the sharded cluster. For example, do not use a 3.2 or - earlier version of :binary:`~bin.mongo` shell against the 3.4 sharded - cluster. - Check the Balancer State ------------------------ @@ -58,13 +51,6 @@ Check if Balancer is Running To see if the balancer process is active in your :term:`cluster `: -.. important:: - - Use the version of the :binary:`~bin.mongo` shell that corresponds to - the version of the sharded cluster. For example, do not use a 3.2 or - earlier version of :binary:`~bin.mongo` shell against the 3.4 sharded - cluster. - #. Connect to any :binary:`~bin.mongos` in the cluster using the :binary:`~bin.mongo` shell. diff --git a/source/tutorial/manage-the-database-profiler.txt b/source/tutorial/manage-the-database-profiler.txt index 27ff00ae72f..76fa8c3704e 100644 --- a/source/tutorial/manage-the-database-profiler.txt +++ b/source/tutorial/manage-the-database-profiler.txt @@ -54,7 +54,7 @@ Enable and Configure Database Profiling You can enable database profiling for :binary:`~bin.mongod` instances. -This section uses the :binary:`~bin.mongo` shell helper +This section uses :mongosh:`mongosh ` helper :method:`db.setProfilingLevel()` helper to enable profiling. For instructions using the driver, see your :driver:`driver documentation `. @@ -69,7 +69,7 @@ database after you enable profiling for that database. To enable profiling and set the profiling level, pass the profiling level to the :method:`db.setProfilingLevel()` helper. For example, to enable profiling for all database operations, consider the following -operation in the :binary:`~bin.mongo` shell: +operation in :mongosh:`mongosh `: .. code-block:: javascript @@ -260,7 +260,7 @@ Check Profiling Level ~~~~~~~~~~~~~~~~~~~~~ To view the :ref:`profiling level `, issue -the following from the :binary:`~bin.mongo` shell: +the following from :mongosh:`mongosh `: .. code-block:: javascript @@ -283,8 +283,8 @@ that should be profiled. Disable Profiling ~~~~~~~~~~~~~~~~~ -To disable profiling, use the following helper in the :binary:`~bin.mongo` -shell: +To disable profiling, use the following helper in +:mongosh:`mongosh `: .. code-block:: javascript @@ -427,9 +427,9 @@ Show the Five Most Recent Events ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On a database that has profiling enabled, the ``show profile`` helper -in the :binary:`~bin.mongo` shell displays the 5 most recent operations +in :mongosh:`mongosh ` displays the 5 most recent operations that took at least 1 millisecond to execute. Issue ``show profile`` -from the :binary:`~bin.mongo` shell, as follows: +from :mongosh:`mongosh `, as follows: .. code-block:: javascript @@ -480,8 +480,8 @@ must: For example, to create a new :data:`system.profile <.system.profile>` collection that is ``4000000`` bytes -(4 MB), use the following sequence of operations in the -:binary:`~bin.mongo` shell: +(4 MB), use the following sequence of operations in +:mongosh:`mongosh `: .. code-block:: javascript diff --git a/source/tutorial/map-reduce-examples.txt b/source/tutorial/map-reduce-examples.txt index 466dd5d64b8..6f9c96fa00d 100644 --- a/source/tutorial/map-reduce-examples.txt +++ b/source/tutorial/map-reduce-examples.txt @@ -25,7 +25,7 @@ Map-Reduce Examples aggregation operators starting in version 4.4. Use these operators to define custom aggregation expressions in JavaScript. -In the :binary:`~bin.mongo` shell, the :method:`db.collection.mapReduce()` +In :mongosh:`mongosh `, the :method:`db.collection.mapReduce()` method is a wrapper around the :dbcommand:`mapReduce` command. The following examples use the :method:`db.collection.mapReduce()` method. diff --git a/source/tutorial/merge-chunks-in-sharded-cluster.txt b/source/tutorial/merge-chunks-in-sharded-cluster.txt index 18a1c5d465c..36d35c97248 100644 --- a/source/tutorial/merge-chunks-in-sharded-cluster.txt +++ b/source/tutorial/merge-chunks-in-sharded-cluster.txt @@ -29,7 +29,7 @@ Procedure Identify Chunk Ranges ~~~~~~~~~~~~~~~~~~~~~ -In the :binary:`~bin.mongo` shell, identify the :term:`chunk` +In :mongosh:`mongosh `, identify the :term:`chunk` ranges with the following operation: .. code-block:: javascript diff --git a/source/tutorial/migrate-chunks-in-sharded-cluster.txt b/source/tutorial/migrate-chunks-in-sharded-cluster.txt index 8f8d79d5d1a..74c2b3a2d28 100644 --- a/source/tutorial/migrate-chunks-in-sharded-cluster.txt +++ b/source/tutorial/migrate-chunks-in-sharded-cluster.txt @@ -32,8 +32,8 @@ between shards, see :ref:`sharding-balancing-internals` and The following example assumes that the field ``username`` is the :term:`shard key` for a collection named ``users`` in the ``myapp`` database, and that the value ``smith`` exists within the :term:`chunk` - to migrate. Migrate the chunk using the following command in the - :binary:`~bin.mongo` shell. + to migrate. Migrate the chunk using the following command in + :mongosh:`mongosh `. .. code-block:: javascript diff --git a/source/tutorial/model-monetary-data.txt b/source/tutorial/model-monetary-data.txt index c0ed709e395..5304e396c5b 100644 --- a/source/tutorial/model-monetary-data.txt +++ b/source/tutorial/model-monetary-data.txt @@ -85,7 +85,7 @@ Unlike binary-based floating-point formats (i.e., the ``double`` BSON type), decimal128 does not approximate decimal values and is able to provide the exact precision required for working with monetary data. -From the :binary:`~bin.mongo` shell ``decimal`` values are assigned and +From :mongosh:`mongosh ` ``decimal`` values are assigned and queried using the ``NumberDecimal()`` constructor. The following example adds a document containing gas prices to a ``gasprices`` collection: diff --git a/source/tutorial/modify-chunk-size-in-sharded-cluster.txt b/source/tutorial/modify-chunk-size-in-sharded-cluster.txt index 7559d2212d7..3c2e4609fdd 100644 --- a/source/tutorial/modify-chunk-size-in-sharded-cluster.txt +++ b/source/tutorial/modify-chunk-size-in-sharded-cluster.txt @@ -20,8 +20,8 @@ megabytes, inclusive. To modify the chunk size, use the following procedure: -#. Connect to any :binary:`~bin.mongos` in the cluster using the - :binary:`~bin.mongo` shell. +#. Connect to any :binary:`~bin.mongos` in the cluster using + :mongosh:`mongosh `. #. Issue the following command to switch to the :ref:`config-database`: diff --git a/source/tutorial/perform-incremental-map-reduce.txt b/source/tutorial/perform-incremental-map-reduce.txt index ef4904224c8..b48cf7dcf2e 100644 --- a/source/tutorial/perform-incremental-map-reduce.txt +++ b/source/tutorial/perform-incremental-map-reduce.txt @@ -21,7 +21,7 @@ Perform Incremental Map-Reduce :doc:`/reference/map-reduce-to-aggregation-pipeline`. To perform map-reduce operations, MongoDB provides the -:dbcommand:`mapReduce` command and, in the :binary:`~bin.mongo` shell, +:dbcommand:`mapReduce` command and, in :mongosh:`mongosh `, the :method:`db.collection.mapReduce()` wrapper method. If the map-reduce data set is constantly growing, you may want to diff --git a/source/tutorial/remove-documents.txt b/source/tutorial/remove-documents.txt index dc75a125c19..52590b78a38 100644 --- a/source/tutorial/remove-documents.txt +++ b/source/tutorial/remove-documents.txt @@ -29,7 +29,7 @@ upper-right to set the language of the following examples. tabs: - id: shell content: | - This page uses the following :binary:`~bin.mongo` shell methods: + This page uses the following :mongosh:`mongosh ` methods: - :method:`db.collection.deleteMany()` - :method:`db.collection.deleteOne()` diff --git a/source/tutorial/remove-replica-set-member.txt b/source/tutorial/remove-replica-set-member.txt index b4b5d8484ee..e522c21edbd 100644 --- a/source/tutorial/remove-replica-set-member.txt +++ b/source/tutorial/remove-replica-set-member.txt @@ -17,8 +17,8 @@ Remove a Member Using ``rs.remove()`` ------------------------------------- 1. Shut down the :binary:`~bin.mongod` instance for the member you wish to - remove. To shut down the instance, connect using the - :binary:`~bin.mongo` shell and the :method:`db.shutdownServer()` + remove. To shut down the instance, connect using + :mongosh:`mongosh ` and use the :method:`db.shutdownServer()` method. #. Connect to the replica set's current :term:`primary`. To determine @@ -59,8 +59,8 @@ Procedure ~~~~~~~~~ 1. Shut down the :binary:`~bin.mongod` instance for the member you wish to - remove. To shut down the instance, connect using the - :binary:`~bin.mongo` shell and the :method:`db.shutdownServer()` + remove. To shut down the instance, connect using + :mongosh:`mongosh ` and use the :method:`db.shutdownServer()` method. #. Connect to the replica set's current :term:`primary`. To determine diff --git a/source/tutorial/remove-shards-from-cluster.txt b/source/tutorial/remove-shards-from-cluster.txt index 5fb80a7f9ce..c454a22b715 100644 --- a/source/tutorial/remove-shards-from-cluster.txt +++ b/source/tutorial/remove-shards-from-cluster.txt @@ -22,8 +22,9 @@ hardware. To migrate, see :doc:`/tutorial/migrate-sharded-cluster-to-new-hardware` instead. To remove a shard, first connect to one of the cluster's -:binary:`~bin.mongos` instances using :binary:`~bin.mongo` shell. Then use the -sequence of tasks in this document to remove a shard from the cluster. +:binary:`~bin.mongos` instances using :mongosh:`mongosh `. Then use +the sequence of tasks in this document to remove a shard from the +cluster. Considerations -------------- @@ -38,7 +39,7 @@ Ensure the Balancer Process is Enabled To successfully migrate data from a shard, the :term:`balancer` process **must** be enabled. Check the balancer state using the -:method:`sh.getBalancerState()` helper in the :binary:`~bin.mongo` shell. +:method:`sh.getBalancerState()` helper in :mongosh:`mongosh `. For more information, see the section on :ref:`balancer operations `. @@ -48,7 +49,7 @@ Determine the Name of the Shard to Remove ----------------------------------------- To determine the name of the shard, connect to a :binary:`~bin.mongos` -instance with the :binary:`~bin.mongo` shell and either: +instance with :mongosh:`mongosh ` and either: - Use the :dbcommand:`listShards` command, as in the following: diff --git a/source/tutorial/resync-replica-set-member.txt b/source/tutorial/resync-replica-set-member.txt index 48bafdbdc48..58889964935 100644 --- a/source/tutorial/resync-replica-set-member.txt +++ b/source/tutorial/resync-replica-set-member.txt @@ -81,7 +81,7 @@ perform an initial sync by restarting the instance without the contents of the 1. Stop the member's :binary:`~bin.mongod` instance. To ensure a clean shutdown, use the :method:`db.shutdownServer()` - method from the :binary:`~bin.mongo` shell or on Linux systems, the + method from :mongosh:`mongosh ` or on Linux systems, the :option:`mongod --shutdown` option. 2. (Optional) Make a backup of all data and sub-directories from the diff --git a/source/tutorial/rotate-encryption-key.txt b/source/tutorial/rotate-encryption-key.txt index 3c2f9f70152..5783fad0669 100644 --- a/source/tutorial/rotate-encryption-key.txt +++ b/source/tutorial/rotate-encryption-key.txt @@ -47,7 +47,7 @@ For a replica set, to rotate out a member: --kmipServerName \ --kmipServerCAFile ca.pem --kmipClientCertificateFile client.pem -#. Connect a :binary:`~bin.mongo` shell to the replica set's primary. +#. Connect :mongosh:`mongosh ` to the replica set's primary. #. Add the instance to the replica set: @@ -116,7 +116,7 @@ to re-encrypt the entire data set. #. Step down the replica set primary. - Connect a :binary:`~bin.mongo` shell to the primary and use + Connect :mongosh:`mongosh ` to the primary and use :method:`rs.stepDown()` to step down the primary and force an election of a new primary: diff --git a/source/tutorial/rotate-key-replica-set.txt b/source/tutorial/rotate-key-replica-set.txt index 040a92e6874..d2e84ede2b4 100644 --- a/source/tutorial/rotate-key-replica-set.txt +++ b/source/tutorial/rotate-key-replica-set.txt @@ -95,7 +95,7 @@ sequence of keys. Once all the keyfiles contain both the old and new keys, restart each member one at a time. -**For each secondary member**, connect a :binary:`~bin.mongo` shell to the +**For each secondary member**, connect :mongosh:`mongosh ` to the member and: a. Use the :method:`db.shutdownServer()` method to shut down the member: @@ -107,7 +107,7 @@ a. Use the :method:`db.shutdownServer()` method to shut down the member: b. Restart the member. -**For the primary**, connect a :binary:`~bin.mongo` shell to the member and +**For the primary**, connect :mongosh:`mongosh ` to the member and a. Use :method:`rs.stepDown()` to step down the member: @@ -151,7 +151,7 @@ Modify each member's keyfile to include only the new password. Once all the keyfiles contain the new key only, restart each member one at a time. -**For each secondary member**, connect a :binary:`~bin.mongo` shell to the +**For each secondary member**, connect :mongosh:`mongosh ` to the member and: a. Use the :method:`db.shutdownServer()` method to shut down the member: @@ -163,7 +163,7 @@ a. Use the :method:`db.shutdownServer()` method to shut down the member: b. Restart the member. -**For the primary**, connect a :binary:`~bin.mongo` shell to the member and +**For the primary**, connect :mongosh:`mongosh ` to the member and a. Use :method:`rs.stepDown()` to step down the member: diff --git a/source/tutorial/rotate-key-sharded-cluster.txt b/source/tutorial/rotate-key-sharded-cluster.txt index f6b1c9e8a97..2fb147bf43d 100644 --- a/source/tutorial/rotate-key-sharded-cluster.txt +++ b/source/tutorial/rotate-key-sharded-cluster.txt @@ -100,7 +100,7 @@ Config Servers `````````````` **For each secondary of the config server replica set (CSRS)**, -connect a :binary:`~bin.mongo` shell to the member and: +connect :mongosh:`mongosh ` to the member and: a. Use the :method:`db.shutdownServer()` method to shut down the member: @@ -111,7 +111,7 @@ a. Use the :method:`db.shutdownServer()` method to shut down the member: b. Restart the member. -**For the primary**, connect a :binary:`~bin.mongo` shell to the member and +**For the primary**, connect :mongosh:`mongosh ` to the member and a. Use :method:`rs.stepDown()` to step down the member: @@ -132,8 +132,8 @@ a. Use :method:`rs.stepDown()` to step down the member: Shard Replica Sets `````````````````` -**For each secondary member of the shard replica sets**, connect a -:binary:`~bin.mongo` shell to the member and: +**For each secondary member of the shard replica sets**, connect +:mongosh:`mongosh ` to the member and: a. Use the :method:`db.shutdownServer()` method to shut down the member: @@ -144,8 +144,8 @@ a. Use the :method:`db.shutdownServer()` method to shut down the member: b. Restart the member. -**For the primary of each shard replica set**, connect a -:binary:`~bin.mongo` shell to the member and +**For the primary of each shard replica set**, connect +:mongosh:`mongosh ` to the member and a. Use :method:`rs.stepDown()` to step down the member: @@ -167,8 +167,8 @@ a. Use :method:`rs.stepDown()` to step down the member: ``mongos`` Routers `````````````````` -**For each mongos/router instance**, connect a -:binary:`~bin.mongo` shell to the :binary:`~bin.mongos` instance and: +**For each mongos/router instance**, connect +:mongosh:`mongosh ` to the :binary:`~bin.mongos` instance and: a. Use the :method:`db.shutdownServer()` method to shut down the member: @@ -208,7 +208,7 @@ Config Servers `````````````` **For each secondary of the config server replica set (CSRS)**, -connect a :binary:`~bin.mongo` shell to the member and: +connect :mongosh:`mongosh ` to the member and: a. Use the :method:`db.shutdownServer()` method to shut down the member: @@ -219,7 +219,7 @@ a. Use the :method:`db.shutdownServer()` method to shut down the member: b. Restart the member. -**For the primary**, connect a :binary:`~bin.mongo` shell to the member and +**For the primary**, connect :mongosh:`mongosh ` to the member and a. Use :method:`rs.stepDown()` to step down the member: @@ -240,8 +240,8 @@ a. Use :method:`rs.stepDown()` to step down the member: Shard Replica Sets `````````````````` -**For each secondary member of the shard replica sets**, connect a -:binary:`~bin.mongo` shell to the member and: +**For each secondary member of the shard replica sets**, connect +:mongosh:`mongosh ` to the member and: a. Use the :method:`db.shutdownServer()` method to shut down the member: @@ -252,8 +252,8 @@ a. Use the :method:`db.shutdownServer()` method to shut down the member: b. Restart the member. -**For the primary of each shard replica set**, connect a -:binary:`~bin.mongo` shell to the member and +**For the primary of each shard replica set**, connect +:mongosh:`mongosh ` to the member and a. Use :method:`rs.stepDown()` to step down the member: @@ -274,8 +274,8 @@ a. Use :method:`rs.stepDown()` to step down the member: ``mongos`` Routers `````````````````` -**For each mongos/router instance**, connect a -:binary:`~bin.mongo` shell to the :binary:`~bin.mongos` instance and: +**For each mongos/router instance**, connect +:mongosh:`mongosh ` to the :binary:`~bin.mongos` instance and: a. Use the :method:`db.shutdownServer()` method to shut down the member: diff --git a/source/tutorial/rotate-x509-membership-certificates.txt b/source/tutorial/rotate-x509-membership-certificates.txt index 6df6a48fafc..99e3a4708c8 100644 --- a/source/tutorial/rotate-x509-membership-certificates.txt +++ b/source/tutorial/rotate-x509-membership-certificates.txt @@ -67,7 +67,7 @@ procedure completes. To avoid these messages, you can set the override parameter on running members. -Connect a :binary:`~bin.mongo` shell directly to each member of the +Connect :mongosh:`mongosh ` directly to each member of the deployment and set the :parameter:`tlsX509ClusterAuthDNOverride` parameter to the new certificate ``DN``: @@ -112,7 +112,7 @@ member (see next step). Once you have modified the configuration for all the members, restart each secondary and then the primary. -**For each secondary member**, connect a :binary:`~bin.mongo` shell to the +**For each secondary member**, connect :mongosh:`mongosh ` to the member and: a. Use the :method:`db.shutdownServer()` method to shut down the member: @@ -127,7 +127,7 @@ b. Restart the member. Ensure the member has reached :replstate:`SECONDARY` state before restarting the next secondary. -**For the primary**, connect a :binary:`~bin.mongo` shell to the member and +**For the primary**, connect :mongosh:`mongosh ` to the member and a. Use :method:`rs.stepDown()` to step down the member: diff --git a/source/tutorial/split-chunks-in-sharded-cluster.txt b/source/tutorial/split-chunks-in-sharded-cluster.txt index 9584a49addf..62facefb4e8 100644 --- a/source/tutorial/split-chunks-in-sharded-cluster.txt +++ b/source/tutorial/split-chunks-in-sharded-cluster.txt @@ -42,7 +42,7 @@ Use :method:`sh.status()` to determine the current chunk ranges across the cluster. To split chunks manually, use the :dbcommand:`split` command with either -fields ``middle`` or ``find``. The :binary:`~bin.mongo` shell provides the +fields ``middle`` or ``find``. :mongosh:`mongosh ` provides the helper methods :method:`sh.splitFind()` and :method:`sh.splitAt()`. :method:`~sh.splitFind()` splits the chunk that contains the *first* diff --git a/source/tutorial/terminate-running-operations.txt b/source/tutorial/terminate-running-operations.txt index 10107ff7786..0c90a12a183 100644 --- a/source/tutorial/terminate-running-operations.txt +++ b/source/tutorial/terminate-running-operations.txt @@ -31,7 +31,7 @@ MongoDB interrupts the operation at the next :term:`interrupt point`. Terminate a Query ````````````````` -From the :binary:`~bin.mongo` shell, use the following method to set a +From :mongosh:`mongosh `, use the following method to set a time limit of 30 milliseconds for this query: .. code-block:: javascript diff --git a/source/tutorial/troubleshoot-kerberos.txt b/source/tutorial/troubleshoot-kerberos.txt index 9c810960c2a..cb32db7e33b 100644 --- a/source/tutorial/troubleshoot-kerberos.txt +++ b/source/tutorial/troubleshoot-kerberos.txt @@ -90,7 +90,7 @@ Kerberos Trace Logging on Linux MIT Kerberos provides the ``KRB5_TRACE`` environment variable for trace logging output. If you are having persistent problems with MIT Kerberos on Linux, you can set ``KRB5_TRACE`` when starting your -:binary:`~bin.mongod`, :binary:`~bin.mongos`, or :binary:`~bin.mongo` instances to +:binary:`~bin.mongod`, :binary:`~bin.mongos`, or :mongosh:`mongosh ` instances to produce verbose logging. For example, the following command starts a standalone :binary:`~bin.mongod` diff --git a/source/tutorial/troubleshoot-map-function.txt b/source/tutorial/troubleshoot-map-function.txt index 73773d01ee5..ac242b19ed1 100644 --- a/source/tutorial/troubleshoot-map-function.txt +++ b/source/tutorial/troubleshoot-map-function.txt @@ -110,5 +110,5 @@ following prototype: The ``map`` function must meet various requirements. For a list of all the requirements for the ``map`` function, see :dbcommand:`mapReduce`, - or the :binary:`~bin.mongo` shell helper method + or :mongosh:`mongosh ` helper method :method:`db.collection.mapReduce()`. diff --git a/source/tutorial/troubleshoot-reduce-function.txt b/source/tutorial/troubleshoot-reduce-function.txt index 97397e32ce2..ff630ebcfa1 100644 --- a/source/tutorial/troubleshoot-reduce-function.txt +++ b/source/tutorial/troubleshoot-reduce-function.txt @@ -33,7 +33,7 @@ must meet various requirements. This tutorial helps verify that the - The ``reduce`` function must be *idempotent*. For a list of all the requirements for the ``reduce`` function, see -:dbcommand:`mapReduce`, or the :binary:`~bin.mongo` shell helper method +:dbcommand:`mapReduce`, or :mongosh:`mongosh ` helper method :method:`db.collection.mapReduce()`. .. note:: diff --git a/source/tutorial/troubleshoot-replica-sets.txt b/source/tutorial/troubleshoot-replica-sets.txt index 734762d8b0e..68462937629 100644 --- a/source/tutorial/troubleshoot-replica-sets.txt +++ b/source/tutorial/troubleshoot-replica-sets.txt @@ -19,10 +19,10 @@ Check Replica Set Status ------------------------ To display the current state of the replica set and current state of -each member, run the :method:`rs.status()` method in a :binary:`~bin.mongo` -shell connected to the replica set's :term:`primary`. For descriptions -of the information displayed by :method:`rs.status()`, see -:doc:`/reference/command/replSetGetStatus`. +each member, run the :method:`rs.status()` method in a +:mongosh:`mongosh ` session that is connected to the replica set's +:term:`primary`. For descriptions of the information displayed by +:method:`rs.status()`, see :doc:`/reference/command/replSetGetStatus`. .. note:: @@ -44,8 +44,8 @@ will be inconsistent. To check the current length of replication lag: -- In a :binary:`~bin.mongo` shell connected to the primary, call the - :method:`rs.printSecondaryReplicationInfo()` method. +- In a :mongosh:`mongosh ` session that is connected to the primary, + call the :method:`rs.printSecondaryReplicationInfo()` method. Returns the ``syncedTo`` value for each member, which shows the time when the last oplog entry was written to the @@ -255,7 +255,7 @@ A larger :term:`oplog` can give a replica set a greater tolerance for lag, and make the set more resilient. To check the size of the oplog for a given :term:`replica set` member, -connect to the member in a :binary:`~bin.mongo` shell and run the +connect to the member in :mongosh:`mongosh ` and run the :method:`rs.printReplicationInfo()` method. The output displays the size of the oplog and the date ranges of the diff --git a/source/tutorial/update-documents.txt b/source/tutorial/update-documents.txt index e6576a77f80..7af47f165b3 100644 --- a/source/tutorial/update-documents.txt +++ b/source/tutorial/update-documents.txt @@ -33,7 +33,7 @@ upper-right to set the language of the following examples. tabs: - id: shell content: | - This page uses the following :binary:`~bin.mongo` shell methods: + This page uses the following :mongosh:`mongosh ` methods: - :method:`db.collection.updateOne(\, \, \) ` diff --git a/source/tutorial/upgrade-revision.txt b/source/tutorial/upgrade-revision.txt index 6896895e840..12f9f3a424a 100644 --- a/source/tutorial/upgrade-revision.txt +++ b/source/tutorial/upgrade-revision.txt @@ -195,8 +195,8 @@ Upgrade each secondary separately as follows: #. After upgrading a secondary, wait for the secondary to recover to the ``SECONDARY`` state before upgrading the next instance. To - check the member's state, issue :method:`rs.status()` in the - :binary:`~bin.mongo` shell. + check the member's state, issue :method:`rs.status()` in + :mongosh:`mongosh `. The secondary may briefly go into ``STARTUP2`` or ``RECOVERING``. This is normal. Make sure to wait for the secondary to fully recover @@ -208,7 +208,7 @@ Upgrade the Primary 1. Step down the primary to initiate the normal :ref:`failover ` procedure. Using one of the following: - - The :method:`rs.stepDown()` helper in the :binary:`~bin.mongo` shell. + - The :method:`rs.stepDown()` helper in :mongosh:`mongosh `. - The :dbcommand:`replSetStepDown` database command. @@ -221,7 +221,7 @@ Upgrade the Primary failover procedure. #. Once the primary has stepped down, call the :method:`rs.status()` - method from the :binary:`~bin.mongo` shell until you see that another + method from :mongosh:`mongosh ` until you see that another member has assumed the ``PRIMARY`` state. #. Shut down the original primary and upgrade its instance by diff --git a/source/tutorial/use-database-commands.txt b/source/tutorial/use-database-commands.txt index d263e4b8749..5170a3b7538 100644 --- a/source/tutorial/use-database-commands.txt +++ b/source/tutorial/use-database-commands.txt @@ -37,9 +37,9 @@ specify the :dbcommand:`hello` command using the following Issue Commands -------------- -The :binary:`~bin.mongo` shell provides a helper method for running +:mongosh:`mongosh ` provides a helper method for running commands called :method:`db.runCommand()`. The following operation in -:binary:`~bin.mongo` runs the previous command: +:mongosh:`mongosh ` runs the previous command: .. code-block:: javascript @@ -50,10 +50,9 @@ the :method:`db.runCommand()` method. Internally, running commands with :method:`db.runCommand()` is equivalent to a special query against the :term:`$cmd` collection. -Many common commands have their own shell helpers or wrappers in the -:binary:`~bin.mongo` shell and drivers, such as the -:method:`db.hello()` method in the :binary:`~bin.mongo` JavaScript -shell. +Many common commands have their own shell helpers or wrappers in +:mongosh:`mongosh ` and drivers, such as the +:method:`db.hello()` method in :mongosh:`mongosh `. You can use the ``maxTimeMS`` option to specify a time limit for the execution of a command, see :ref:`terminate-long-running-commands` for diff --git a/source/tutorial/view-sharded-cluster-configuration.txt b/source/tutorial/view-sharded-cluster-configuration.txt index 892f2ac471c..bf6c36cdbc1 100644 --- a/source/tutorial/view-sharded-cluster-configuration.txt +++ b/source/tutorial/view-sharded-cluster-configuration.txt @@ -20,9 +20,9 @@ List Databases with Sharding Enabled To list the databases that have sharding enabled, query the ``databases`` collection in the :ref:`config-database`. A database has sharding enabled if the value of the ``partitioned`` -field is ``true``. Connect to a :binary:`~bin.mongos` instance with a -:binary:`~bin.mongo` shell, and run the following operation to get a full -list of databases with sharding enabled: +field is ``true``. Connect :mongosh:`mongosh ` to a +:binary:`~bin.mongos` instance and run the following operation to get a +full list of databases with sharding enabled: .. code-block:: javascript diff --git a/source/tutorial/write-scripts-for-the-mongo-shell.txt b/source/tutorial/write-scripts-for-the-mongo-shell.txt index 119176d1d4e..10eb5448298 100644 --- a/source/tutorial/write-scripts-for-the-mongo-shell.txt +++ b/source/tutorial/write-scripts-for-the-mongo-shell.txt @@ -12,8 +12,8 @@ Write Scripts for the ``mongo`` Shell .. include:: /includes/fact-mongosh-callout.rst -You can write scripts for the :binary:`~bin.mongo` shell in JavaScript that -manipulate data in MongoDB or perform administrative operation. +You can write scripts for the :binary:`~bin.mongo` shell in JavaScript +that manipulate data in MongoDB or perform administrative operation. This tutorial provides an introduction to writing JavaScript that uses the :binary:`~bin.mongo` shell to access MongoDB. @@ -64,7 +64,7 @@ Differences Between Interactive and Scripted ``mongo`` .. note:: - Starting in version 4.2, :binary:`~bin.mongo` shell provides the + Starting in version 4.2, the :binary:`~bin.mongo` shell provides the method :method:`isInteractive()` that returns a boolean indicating whether the :binary:`~bin.mongo` shell is running in interactive or script mode. @@ -185,8 +185,8 @@ following: -- In interactive mode, :binary:`~bin.mongo` prints the results of - operations including the content of all cursors. In scripts, either +- In interactive mode, the :binary:`~bin.mongo` shell prints the results + of operations including the content of all cursors. In scripts, either use the JavaScript ``print()`` function or the :binary:`~bin.mongo` specific ``printjson()`` function which returns formatted JSON. @@ -207,13 +207,15 @@ following: Scripting --------- -From the system prompt, use :binary:`~bin.mongo` to evaluate JavaScript. +From the system prompt, use the :binary:`~bin.mongo` shell to evaluate +JavaScript. ``--eval`` option ~~~~~~~~~~~~~~~~~ -Use the :option:`--eval ` option to :binary:`~bin.mongo` to -pass the shell a JavaScript fragment, as in the following: +Use the :option:`--eval ` option to the +:binary:`~bin.mongo` shell to pass the shell a JavaScript fragment, as +in the following: .. code-block:: bash