diff --git a/source/appendix/security/appendixC-openssl-client.txt b/source/appendix/security/appendixC-openssl-client.txt index bbdc157bbca..b5d0f883171 100644 --- a/source/appendix/security/appendixC-openssl-client.txt +++ b/source/appendix/security/appendixC-openssl-client.txt @@ -142,7 +142,7 @@ B. Generate the Test PEM File for Client .. code-block:: javascript - mongo --tls --host --tlsCertificateKeyFile test-client.pem --tlsCAFile test-ca.pem + mongosh --tls --host --tlsCertificateKeyFile test-client.pem --tlsCAFile test-ca.pem .. example:: @@ -151,7 +151,7 @@ B. Generate the Test PEM File for Client .. code-block:: javascript - mongo --ssl --host --sslPEMKeyFile test-client.pem --sslCAFile test-ca.pem + mongosh --ssl --host --sslPEMKeyFile test-client.pem --sslCAFile test-ca.pem On macOS, If you are :red:`testing` with Keychain Access to manage certificates, @@ -172,7 +172,7 @@ B. Generate the Test PEM File for Client .. code-block:: javascript - mongo --tls --tlsCertificateSelector subject="" + mongosh --tls --tlsCertificateSelector subject="" Although still available, :option:`--ssl ` and :option:`--sslCertificateSelector ` command-line option, :mongosh:`mongosh ` diff --git a/source/includes/extracts-client-side-field-level-encryption.yaml b/source/includes/extracts-client-side-field-level-encryption.yaml index 0f33c0b431f..3120d8de66c 100644 --- a/source/includes/extracts-client-side-field-level-encryption.yaml +++ b/source/includes/extracts-client-side-field-level-encryption.yaml @@ -57,7 +57,7 @@ content: | .. code-block:: bash - mongo --eval " + mongosh --eval " var AWS_ACCESS_KEY_ID = '$AWS_ACCESS_KEY_ID' var AWS_SECRET_ACCESS_KEY = '$AWS_SECRET_ACCESS_KEY' " \ @@ -82,7 +82,7 @@ content: | TEST_LOCAL_KEY=$(echo "$(head -c 96 /dev/urandom | base64 | tr -d '\n')") - mongo --nodb --shell --eval "var TEST_LOCAL_KEY='$TEST_LOCAL_KEY'" + mongosh --nodb --shell --eval "var TEST_LOCAL_KEY='$TEST_LOCAL_KEY'" Create the client-side field level encryption object using the generated local key string: diff --git a/source/includes/fact-default-bind-ip.rst b/source/includes/fact-default-bind-ip.rst index a9da0ea195a..e137a6c39d3 100644 --- a/source/includes/fact-default-bind-ip.rst +++ b/source/includes/fact-default-bind-ip.rst @@ -41,8 +41,8 @@ the hostname or its associated ip address ``198.51.100.1``: .. code-block:: none - mongo --host My-Example-Associated-Hostname + mongosh --host My-Example-Associated-Hostname - mongo --host 198.51.100.1 + mongosh --host 198.51.100.1 .. end-override diff --git a/source/includes/steps-authenticate-as-client.yaml b/source/includes/steps-authenticate-as-client.yaml index f7f9ae5f2b8..678031c456c 100644 --- a/source/includes/steps-authenticate-as-client.yaml +++ b/source/includes/steps-authenticate-as-client.yaml @@ -9,7 +9,7 @@ action: example: language: javascript code: | - mongo --username "prodManager" --password "cleartextPassword" --authenticationDatabase "products" + mongosh --username "prodManager" --password "cleartextPassword" --authenticationDatabase "products" --- title: Close the session when your work is complete. stepnum: 2 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 5f7a81346f5..c114828d982 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 @@ -9,7 +9,7 @@ pre: | action: language: javascript code: | - mongo --port 27017 -u myUserAdmin -p --authenticationDatabase 'admin' + mongosh --port 27017 -u myUserAdmin -p --authenticationDatabase 'admin' post: | If you do not specify the password to the :option:`-p ` command-line option, :mongosh:`mongosh ` prompts for the 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 c7e7f08842c..db611909bd9 100644 --- a/source/includes/steps-change-own-password-and-custom-data.yaml +++ b/source/includes/steps-change-own-password-and-custom-data.yaml @@ -11,7 +11,7 @@ action: section. language: javascript code: | - mongo --port 27017 -u user123 --authenticationDatabase 'test' -p + mongosh --port 27017 -u user123 --authenticationDatabase 'test' -p post: | If you do not specify the password to the :option:`-p ` diff --git a/source/includes/steps-configure-ldap-mongodb.yaml b/source/includes/steps-configure-ldap-mongodb.yaml index fd2468ffcd6..65a860b6beb 100644 --- a/source/includes/steps-configure-ldap-mongodb.yaml +++ b/source/includes/steps-configure-ldap-mongodb.yaml @@ -98,7 +98,7 @@ content: | .. code-block:: bash - mongo --host --authenticationMechanism PLAIN --authenticationDatabase '$external' -u -p + mongosh --host --authenticationMechanism PLAIN --authenticationDatabase '$external' -u -p - id: authafter name: Authenticate after Connection diff --git a/source/includes/steps-configure-ldap-sasl-activedirectory-authentication.yaml b/source/includes/steps-configure-ldap-sasl-activedirectory-authentication.yaml index 636b69107c4..da4188c2153 100644 --- a/source/includes/steps-configure-ldap-sasl-activedirectory-authentication.yaml +++ b/source/includes/steps-configure-ldap-sasl-activedirectory-authentication.yaml @@ -301,7 +301,7 @@ pre: | .. code-block:: bash - mongo --username sam@DBA.EXAMPLE.COM --password --authenticationMechanism 'PLAIN' --authenticationDatabase '$external' --host --port + mongosh --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, :mongosh:`mongosh ` diff --git a/source/includes/steps-connect-with-admin-privileges.yaml b/source/includes/steps-connect-with-admin-privileges.yaml index a2052eb2927..b538abd15e8 100644 --- a/source/includes/steps-connect-with-admin-privileges.yaml +++ b/source/includes/steps-connect-with-admin-privileges.yaml @@ -12,5 +12,5 @@ action: :doc:`/tutorial/enable-authentication`. language: javascript code: | - mongo --port 27017 -u myUserAdmin -p 'abc123' --authenticationDatabase 'admin' + mongosh --port 27017 -u myUserAdmin -p 'abc123' --authenticationDatabase 'admin' ... 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 e48396cf217..3614a293335 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 @@ -112,7 +112,7 @@ action: - pre: You can connect and authenticate from the command line. language: sh code: | - mongo --host hostname.example.net --authenticationMechanism=GSSAPI --authenticationDatabase='$external' --username application/reporting@EXAMPLE.NET + mongosh --host hostname.example.net --authenticationMechanism=GSSAPI --authenticationDatabase='$external' --username application/reporting@EXAMPLE.NET post: | If you are connecting to a system whose hostname matches the Kerberos name, ensure that you specify the fully qualified 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 b4b58780b1f..f67c32535c7 100644 --- a/source/includes/steps-convert-replica-set-add-new-shard.yaml +++ b/source/includes/steps-convert-replica-set-add-new-shard.yaml @@ -34,7 +34,7 @@ action: copyable: true language: javascript code: | - mongo mongodb3.example.net + mongosh mongodb3.example.net --- title: "Initiate the replica set." level: 4 @@ -69,7 +69,7 @@ action: copyable: true language: javascript code: | - mongo mongodb6.example.net:27017/admin + mongosh mongodb6.example.net:27017/admin --- title: text: Add the shard. diff --git a/source/includes/steps-convert-replica-set-add-shards.yaml b/source/includes/steps-convert-replica-set-add-shards.yaml index ad1c461437e..56ffedca336 100644 --- a/source/includes/steps-convert-replica-set-add-shards.yaml +++ b/source/includes/steps-convert-replica-set-add-shards.yaml @@ -6,7 +6,7 @@ ref: connect-mongos action: language: javascript code: | - mongo mongodb6.example.net:27017/admin + mongosh mongodb6.example.net:27017/admin --- title: text: Add the shard. diff --git a/source/includes/steps-create-admin-then-enable-authentication.yaml b/source/includes/steps-create-admin-then-enable-authentication.yaml index eb26ddb2b12..4ec55a2fd89 100644 --- a/source/includes/steps-create-admin-then-enable-authentication.yaml +++ b/source/includes/steps-create-admin-then-enable-authentication.yaml @@ -26,7 +26,7 @@ pre: | action: language: sh code: | - mongo --port 27017 + mongosh --port 27017 post: | Specify additional command line options as appropriate to connect :mongosh:`mongosh ` to your deployment, such as ``--host``. @@ -132,7 +132,7 @@ content: | .. code-block:: bash - mongo --port 27017 --authenticationDatabase "admin" -u "myUserAdmin" -p + mongosh --port 27017 --authenticationDatabase "admin" -u "myUserAdmin" -p Enter your password when prompted. @@ -145,7 +145,7 @@ content: | .. code-block:: bash - mongo --port 27017 + mongosh --port 27017 In :mongosh:`mongosh `, switch to the @@ -237,7 +237,7 @@ content: | .. code-block:: bash - mongo --port 27017 -u "myTester" --authenticationDatabase "test" -p + mongosh --port 27017 -u "myTester" --authenticationDatabase "test" -p Enter the password for the user when prompted. @@ -250,7 +250,7 @@ content: | .. code-block:: bash - mongo --port 27017 + mongosh --port 27017 In :mongosh:`mongosh `, switch to the authentication database (in this case, ``test``), and use diff --git a/source/includes/steps-csfle-shell-aws-create-key.yaml b/source/includes/steps-csfle-shell-aws-create-key.yaml index fca81864afb..6b59568a98c 100644 --- a/source/includes/steps-csfle-shell-aws-create-key.yaml +++ b/source/includes/steps-csfle-shell-aws-create-key.yaml @@ -25,7 +25,7 @@ content: | .. code-block:: bash - mongo --eval " + mongosh --eval " var AWS_ACCESS_KEY_ID = '$AWS_ACCESS_KEY_ID' var AWS_SECRET_ACCESS_KEY = '$AWS_SECRET_ACCESS_KEY' " \ diff --git a/source/includes/steps-csfle-shell-azure-create-key.yaml b/source/includes/steps-csfle-shell-azure-create-key.yaml index 8b177c05fa0..4ef5df1e93f 100644 --- a/source/includes/steps-csfle-shell-azure-create-key.yaml +++ b/source/includes/steps-csfle-shell-azure-create-key.yaml @@ -24,7 +24,7 @@ content: | .. code-block:: bash - mongo --eval " + mongosh --eval " var AZURE_TENANT_ID = '$AZURE_TENANT_ID' var AZURE_CLIENT_ID = '$AZURE_CLIENT_ID' var AZURE_CLIENT_SECRET = '$AZURE_CLIENT_SECRET' diff --git a/source/includes/steps-csfle-shell-gcp-create-key.yaml b/source/includes/steps-csfle-shell-gcp-create-key.yaml index ae1920de190..21f0be98af2 100644 --- a/source/includes/steps-csfle-shell-gcp-create-key.yaml +++ b/source/includes/steps-csfle-shell-gcp-create-key.yaml @@ -23,7 +23,7 @@ content: | .. code-block:: bash - mongo --eval " + mongosh --eval " var GCP_EMAIL = '$GCP_EMAIL' var GCP_PRIVATEKEY = '$GCP_PRIVATEKEY' " \ diff --git a/source/includes/steps-csfle-shell-local-create-key.yaml b/source/includes/steps-csfle-shell-local-create-key.yaml index ebe4ae7ece6..d18560cd27c 100644 --- a/source/includes/steps-csfle-shell-local-create-key.yaml +++ b/source/includes/steps-csfle-shell-local-create-key.yaml @@ -43,7 +43,7 @@ content: | .. code-block:: bash - mongo --eval "var LOCAL_KEY = '$DEV_LOCAL_KEY' " \ + mongosh --eval "var LOCAL_KEY = '$DEV_LOCAL_KEY' " \ --shell --nodb The example automatically opens :mongosh:`mongosh ` diff --git a/source/includes/steps-deploy-replica-set-with-auth.yaml b/source/includes/steps-deploy-replica-set-with-auth.yaml index 8b2fb9ae29a..6bf7dd63c05 100644 --- a/source/includes/steps-deploy-replica-set-with-auth.yaml +++ b/source/includes/steps-deploy-replica-set-with-auth.yaml @@ -214,7 +214,7 @@ action: parameters. language: sh code: | - mongo -u "fred" -p --authenticationDatabase "admin" + mongosh -u "fred" -p --authenticationDatabase "admin" post: | If you do not specify the password to the :option:`-p ` command-line option, :mongosh:`mongosh ` prompts for the 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 c7269ee19fb..3b53cc13230 100644 --- a/source/includes/steps-deploy-sharded-cluster-config-server-noauth.yaml +++ b/source/includes/steps-deploy-sharded-cluster-config-server-noauth.yaml @@ -77,7 +77,7 @@ action: copyable: true language: sh code: | - mongo --host --port + mongosh --host --port --- stepnum: 3 title: Initiate the replica set. diff --git a/source/includes/steps-deploy-sharded-cluster-connect.yaml b/source/includes/steps-deploy-sharded-cluster-connect.yaml index 0b6b0617e87..77a9043d631 100644 --- a/source/includes/steps-deploy-sharded-cluster-connect.yaml +++ b/source/includes/steps-deploy-sharded-cluster-connect.yaml @@ -129,7 +129,7 @@ action: to the :binary:`~bin.mongos`. language: sh code: | - mongo -u "fred" -p --authenticationDatabase "admin" + mongosh -u "fred" -p --authenticationDatabase "admin" post: | If you do not specify the password to the :option:`-p ` command-line option, :mongosh:`mongosh ` prompts for the 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 79d78d2d2ea..7f6861ce3a2 100644 --- a/source/includes/steps-deploy-sharded-cluster-shard-replica-noauth.yaml +++ b/source/includes/steps-deploy-sharded-cluster-shard-replica-noauth.yaml @@ -70,7 +70,7 @@ action: copyable: true language: sh code: | - mongo --host --port + mongosh --host --port --- title: Initiate the replica set. level: 4 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 540f7253d62..5ebcf2070ca 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 @@ -157,7 +157,7 @@ action: language: shell code: | - mongo -u joe -password -authenticationDatabase foo --host mongoRepl/mongo1.example.net:27017, mongo2.example.net:27017, mongo3.example.net:27017 + mongosh -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, :mongosh:`mongosh ` prompts for the 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 c861ee93cc9..d6eb6934563 100644 --- a/source/includes/steps-enable-authentication-in-shardcluster-nodowntime-uac.yaml +++ b/source/includes/steps-enable-authentication-in-shardcluster-nodowntime-uac.yaml @@ -97,7 +97,7 @@ pre: | .. code-block:: javascript - mongo --username "joe" --password "" \ + mongosh --username "joe" --password "" \ --authenticationDatabase "marketing" --host mongos1.example.net:27017 If your application uses a MongoDB driver, see the associated diff --git a/source/includes/steps-kerberos-auth-activedirectory-authz.yaml b/source/includes/steps-kerberos-auth-activedirectory-authz.yaml index 4edcc45cbc3..794d9c4ddd8 100644 --- a/source/includes/steps-kerberos-auth-activedirectory-authz.yaml +++ b/source/includes/steps-kerberos-auth-activedirectory-authz.yaml @@ -97,7 +97,7 @@ pre: | .. code-block:: bash - mongo --host --port + mongosh --host --port If your MongoDB server currently enforces authentication, you must authenticate to the ``admin`` database as a user with role management @@ -108,7 +108,7 @@ pre: | .. code-block:: bash - mongo --host --port --username --password --authenticationDatabase="admin" --authenticationMechanism="" + mongosh --host --port --username --password --authenticationDatabase="admin" --authenticationMechanism="" .. note:: @@ -497,7 +497,7 @@ pre: | .. code-block:: bash - mongo --username sam@DBA.EXAMPLE.COM --password --authenticationMechanisms="GSSAPI" --authenticationDatabase "$external" --host --port + mongosh --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, :mongosh:`mongosh ` diff --git a/source/includes/steps-shard-a-collection-ranged.yaml b/source/includes/steps-shard-a-collection-ranged.yaml index 21f11b9c674..0dae67b9ef7 100644 --- a/source/includes/steps-shard-a-collection-ranged.yaml +++ b/source/includes/steps-shard-a-collection-ranged.yaml @@ -11,7 +11,7 @@ action: parameter passing the port the :binary:`~bin.mongos` listens on. language: javascript code: | - mongo --host --port + mongosh --host --port - pre: | If your cluster enforces :term:`authentication`, add the ``--username``, ``-password``, and ``--authenticationDatabase`` @@ -26,7 +26,7 @@ action: authenticating to the ``admin`` database. language: javascript code: | - mongo --host --port --username --password --authenticationDatabase 'admin' + mongosh --host --port --username --password --authenticationDatabase 'admin' --- title: "Enable Sharding on the Database" level: 4 diff --git a/source/reference/command/getLog.txt b/source/reference/command/getLog.txt index d722c9d6190..d0c3814fbd9 100644 --- a/source/reference/command/getLog.txt +++ b/source/reference/command/getLog.txt @@ -149,7 +149,7 @@ messages associated with replication: .. code-block:: javascript - mongo --quiet --eval "db.adminCommand( { getLog:'global'} ).log.forEach(x => {print(x)})" | jq -c '. | select(.c=="REPL")' + mongosh --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 :mongosh:`mongosh ` as needed, such as :option:`--host @@ -163,7 +163,7 @@ Messages" example for use with :dbcommand:`getLog`: .. code-block:: javascript - mongo --quiet --eval "db.adminCommand( { getLog:'global'} ).log.forEach(x => {print(x)})" | jq -r ".msg" | sort | uniq -c | sort -rn | head -10 + mongosh --quiet --eval "db.adminCommand( { getLog:'global'} ).log.forEach(x => {print(x)})" | jq -r ".msg" | sort | uniq -c | sort -rn | head -10 Examples -------- diff --git a/source/reference/connection-string.txt b/source/reference/connection-string.txt index 4c8b31d911b..401739fa8e8 100644 --- a/source/reference/connection-string.txt +++ b/source/reference/connection-string.txt @@ -1417,7 +1417,7 @@ has been configured to support authentication via `AWS IAM credentials .. code-block:: none - mongo 'mongodb+srv://:@cluster0.example.com/testdb?authSource=$external&authMechanism=MONGODB-AWS' + mongosh 'mongodb+srv://:@cluster0.example.com/testdb?authSource=$external&authMechanism=MONGODB-AWS' Connecting to Atlas using AWS IAM credentials in this manner uses the ``MONGODB-AWS`` :urioption:`authentication mechanism ` @@ -1430,7 +1430,7 @@ as well, provide it with the ``AWS_SESSION_TOKEN`` .. code-block:: none - mongo 'mongodb+srv://:@cluster0.example.com/testdb?authSource=$external&authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:' + mongosh 'mongodb+srv://:@cluster0.example.com/testdb?authSource=$external&authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:' .. note:: @@ -1483,4 +1483,4 @@ using these environment variables: .. code-block:: none - mongo 'mongodb+srv://cluster0.example.com/testdb?authSource=$external&authMechanism=MONGODB-AWS' + mongosh 'mongodb+srv://cluster0.example.com/testdb?authSource=$external&authMechanism=MONGODB-AWS' diff --git a/source/reference/method/Mongo.txt b/source/reference/method/Mongo.txt index 25518ae1901..57742f33a4e 100644 --- a/source/reference/method/Mongo.txt +++ b/source/reference/method/Mongo.txt @@ -291,7 +291,7 @@ it into :mongosh:`mongosh `: TEST_LOCAL_KEY=$(echo "$(head -c 96 /dev/urandom | base64 | tr -d '\n')") - mongo --nodb --shell --eval "var TEST_LOCAL_KEY='$TEST_LOCAL_KEY'" + mongosh --nodb --shell --eval "var TEST_LOCAL_KEY='$TEST_LOCAL_KEY'" The following operation creates a new connection object from within a :mongosh:`mongosh ` session. The @@ -352,7 +352,7 @@ it into :mongosh:`mongosh `: TEST_LOCAL_KEY=$(echo "$(head -c 96 /dev/urandom | base64 | tr -d '\n')") - mongo --nodb --shell --eval "var TEST_LOCAL_KEY='$TEST_LOCAL_KEY'" + mongosh --nodb --shell --eval "var TEST_LOCAL_KEY='$TEST_LOCAL_KEY'" The following operation creates a new connection object from within a :mongosh:`mongosh ` session. The diff --git a/source/reference/method/db.auth.txt b/source/reference/method/db.auth.txt index 0d773d6b9b3..0fc7940a801 100644 --- a/source/reference/method/db.auth.txt +++ b/source/reference/method/db.auth.txt @@ -243,4 +243,4 @@ connecting :mongosh:`mongosh `: .. code-block:: bash - mongo --username "myTestDBUser" --password --authenticationDatabase test --authenticationMechanism SCRAM-SHA-256 + mongosh --username "myTestDBUser" --password --authenticationDatabase test --authenticationMechanism SCRAM-SHA-256 diff --git a/source/reference/method/isInteractive.txt b/source/reference/method/isInteractive.txt index c5524306e05..2293fc1c2d0 100644 --- a/source/reference/method/isInteractive.txt +++ b/source/reference/method/isInteractive.txt @@ -79,7 +79,7 @@ From a terminal/command-line prompt (i.e. not inside .. code-block:: bash - mongo localhost:27017/test testExample.js + mongosh localhost:27017/test testExample.js The operation prints to the terminal information about the MongoDB shell version and various information followed by: diff --git a/source/reference/versioned-api.txt b/source/reference/versioned-api.txt index b95292e67c1..5444de8de43 100644 --- a/source/reference/versioned-api.txt +++ b/source/reference/versioned-api.txt @@ -173,7 +173,7 @@ the :option:`--apiStrict` option. .. code-block:: shell - mongo --apiVersion 1 + mongosh --apiVersion 1 Using this non-strict client allows you to run commands outside of the Versioned API. For example, this non-strict client now allows you to diff --git a/source/tutorial/add-shards-to-shard-cluster.txt b/source/tutorial/add-shards-to-shard-cluster.txt index 83f2d3233fa..4920cf340e8 100644 --- a/source/tutorial/add-shards-to-shard-cluster.txt +++ b/source/tutorial/add-shards-to-shard-cluster.txt @@ -47,7 +47,7 @@ instance. .. code-block:: bash - mongo --host mongos0.example.net --port 27017 + mongosh --host mongos0.example.net --port 27017 #. Add a shard to the cluster using the :method:`sh.addShard()` method, as shown in the examples below. Issue :method:`sh.addShard()` diff --git a/source/tutorial/change-hostnames-in-a-replica-set.txt b/source/tutorial/change-hostnames-in-a-replica-set.txt index eeb20a5328a..31199400e02 100644 --- a/source/tutorial/change-hostnames-in-a-replica-set.txt +++ b/source/tutorial/change-hostnames-in-a-replica-set.txt @@ -118,7 +118,7 @@ This procedure uses the above :ref:`assumptions ` with @@ -229,7 +229,7 @@ To create a role that provides the necessary privileges: .. code-block:: javascript - mongo --port 27017 -u myUserAdmin --authenticationDatabase 'admin' -p + mongosh --port 27017 -u myUserAdmin --authenticationDatabase 'admin' -p #. Create a user role that provides the necessary privileges on the ``system.replset`` collection in the ``local`` database: @@ -283,7 +283,7 @@ Procedure .. code-block:: bash - mongo --port 37017 + mongosh --port 37017 If running with access control, connect as a user with appropriate privileges. See @@ -291,7 +291,7 @@ Procedure .. code-block:: bash - mongo --port 37017 -u userPerformingRename --authenticationDatabase=admin -p + mongosh --port 37017 -u userPerformingRename --authenticationDatabase=admin -p #. Edit the replica set configuration manually. The replica set configuration is the only document in the ``system.replset`` @@ -332,7 +332,7 @@ Procedure .. code-block:: bash - mongo --port 27017 + mongosh --port 27017 #. To confirm the new configuration, call :method:`rs.conf()` in :mongosh:`mongosh `. diff --git a/source/tutorial/change-oplog-size.txt b/source/tutorial/change-oplog-size.txt index 7ff6f2840ca..379f8dc2c92 100644 --- a/source/tutorial/change-oplog-size.txt +++ b/source/tutorial/change-oplog-size.txt @@ -41,7 +41,7 @@ Connect to the replica set member using :mongosh:`mongosh `: .. code-block:: bash - mongo --host : + mongosh --host : .. note:: 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 8b5b2279a83..8f8bcb5b75f 100644 --- a/source/tutorial/configure-a-non-voting-replica-set-member.txt +++ b/source/tutorial/configure-a-non-voting-replica-set-member.txt @@ -43,7 +43,7 @@ down using :dbcommand:`replSetStepDown` or its shell helper .. code-block:: bash - mongo --host ":" + mongosh --host ":" Replace the ```` and ```` with the hostname and port of the replica set primary. Include any other parameters diff --git a/source/tutorial/configure-ssl-clients.txt b/source/tutorial/configure-ssl-clients.txt index 3ce6882bb68..5fd112800c4 100644 --- a/source/tutorial/configure-ssl-clients.txt +++ b/source/tutorial/configure-ssl-clients.txt @@ -141,7 +141,7 @@ the following options: .. code-block:: bash - mongo --tls --host hostname.example.com --tlsCAFile /etc/ssl/caToValidateServerCertificates.pem + mongosh --tls --host hostname.example.com --tlsCAFile /etc/ssl/caToValidateServerCertificates.pem :mongosh:`mongosh ` verifies the certificate presented by the :binary:`~bin.mongod` instance against the specified hostname and @@ -182,7 +182,7 @@ following options: .. code-block:: bash - mongo --tls --host hostname.example.com --tlsCertificateKeyFile /etc/ssl/client.pem --tlsCAFile /etc/ssl/caToValidateServerCertificates.pem + mongosh --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:`--ssl `, :option:`--sslCAFile ` verifies the certificate presented by the :binary:`~bin.mongod` instance against the specified hostname @@ -361,7 +361,7 @@ following options: .. code-block:: bash - mongo --ssl --host hostname.example.com --sslPEMKeyFile /etc/ssl/client.pem --sslCAFile /etc/ssl/ca.pem + mongosh --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 --tlsCAFile --authenticationDatabase '$external' --authenticationMechanism MONGODB-X509 + mongosh --tls --tlsCertificateKeyFile --tlsCAFile --authenticationDatabase '$external' --authenticationMechanism MONGODB-X509 .. list-table:: :header-rows: 1 @@ -389,7 +389,7 @@ authenticate with the client certificate. .. code-block:: bash - mongo --tls --tlsCertificateKeyFile --tlsCAFile + mongosh --tls --tlsCertificateKeyFile --tlsCAFile .. list-table:: :header-rows: 1 @@ -454,7 +454,7 @@ authenticate with the client certificate. .. code-block:: bash - mongo --ssl --sslPEMKeyFile --sslCAFile --authenticationDatabase '$external' --authenticationMechanism MONGODB-X509 + mongosh --ssl --sslPEMKeyFile --sslCAFile --authenticationDatabase '$external' --authenticationMechanism MONGODB-X509 .. list-table:: :header-rows: 1 @@ -497,7 +497,7 @@ authenticate with the client certificate. .. code-block:: bash - mongo --ssl --sslPEMKeyFile --sslCAFile + mongosh --ssl --sslPEMKeyFile --sslCAFile .. list-table:: :header-rows: 1 diff --git a/source/tutorial/deploy-replica-set-for-testing.txt b/source/tutorial/deploy-replica-set-for-testing.txt index ed53d635158..1ed77801809 100644 --- a/source/tutorial/deploy-replica-set-for-testing.txt +++ b/source/tutorial/deploy-replica-set-for-testing.txt @@ -111,7 +111,7 @@ Procedure .. code-block:: bash - mongo --port 27017 + mongosh --port 27017 #. In :mongosh:`mongosh `, use :method:`rs.initiate()` to initiate the replica set. You can create a replica set diff --git a/source/tutorial/deploy-shard-cluster.txt b/source/tutorial/deploy-shard-cluster.txt index ad332f77ab5..96376237d3b 100644 --- a/source/tutorial/deploy-shard-cluster.txt +++ b/source/tutorial/deploy-shard-cluster.txt @@ -184,7 +184,7 @@ Specify the ``host`` and ``port`` on which the ``mongos`` is running: .. code-block:: bash - mongo --host --port + mongosh --host --port Once you have connected :mongosh:`mongosh ` to the :binary:`~bin.mongos`, continue to the next procedure to add shards to diff --git a/source/tutorial/troubleshoot-replica-sets.txt b/source/tutorial/troubleshoot-replica-sets.txt index 68462937629..cda5da9f79d 100644 --- a/source/tutorial/troubleshoot-replica-sets.txt +++ b/source/tutorial/troubleshoot-replica-sets.txt @@ -187,9 +187,9 @@ Consider the following example of a bidirectional test of networking: .. code-block:: bash - mongo --host m2.example.net --port 27017 + mongosh --host m2.example.net --port 27017 - mongo --host m3.example.net --port 27017 + mongosh --host m3.example.net --port 27017 #. Test the connection from ``m2.example.net`` to the other two hosts with the following operation set from ``m2.example.net``, @@ -197,9 +197,9 @@ Consider the following example of a bidirectional test of networking: .. code-block:: bash - mongo --host m1.example.net --port 27017 + mongosh --host m1.example.net --port 27017 - mongo --host m3.example.net --port 27017 + mongosh --host m3.example.net --port 27017 You have now tested the connection between ``m2.example.net`` and ``m1.example.net`` in both directions. @@ -210,9 +210,9 @@ Consider the following example of a bidirectional test of networking: .. code-block:: bash - mongo --host m1.example.net --port 27017 + mongosh --host m1.example.net --port 27017 - mongo --host m2.example.net --port 27017 + mongosh --host m2.example.net --port 27017 If any connection, in any direction fails, check your networking and firewall configuration and reconfigure your environment to