Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions source/appendix/security/appendixC-openssl-client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ B. Generate the Test PEM File for Client

.. code-block:: javascript

mongo --tls --host <serverHost> --tlsCertificateKeyFile test-client.pem --tlsCAFile test-ca.pem
mongosh --tls --host <serverHost> --tlsCertificateKeyFile test-client.pem --tlsCAFile test-ca.pem


.. example::
Expand All @@ -151,7 +151,7 @@ B. Generate the Test PEM File for Client

.. code-block:: javascript

mongo --ssl --host <serverHost> --sslPEMKeyFile test-client.pem --sslCAFile test-ca.pem
mongosh --ssl --host <serverHost> --sslPEMKeyFile test-client.pem --sslCAFile test-ca.pem

On macOS,
If you are :red:`testing` with Keychain Access to manage certificates,
Expand All @@ -172,7 +172,7 @@ B. Generate the Test PEM File for Client

.. code-block:: javascript

mongo --tls --tlsCertificateSelector subject="<TestClientCertificateCommonName>"
mongosh --tls --tlsCertificateSelector subject="<TestClientCertificateCommonName>"

Although still available, :option:`--ssl <mongosh --ssl>` and
:option:`--sslCertificateSelector <mongosh
Expand All @@ -183,7 +183,7 @@ B. Generate the Test PEM File for Client

.. code-block:: javascript

mongo --ssl --sslCertificateSelector subject="<TestClientCertificateCommonName>"
mongosh --ssl --sslCertificateSelector subject="<TestClientCertificateCommonName>"

For adding certificates to Keychain Access, refer to your
official documentation for Keychain Access.
Expand Down
2 changes: 1 addition & 1 deletion source/core/retryable-writes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ MongoDB Drivers

.. code-block:: bash

mongo --retryWrites
mongosh --retryWrites

.. _retryable-write-ops:

Expand Down
2 changes: 1 addition & 1 deletion source/core/security-ldap-external.txt
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ with LDAP authentication and authorization:

.. code-block:: bash

mongo --username alice@dba.example.com --password --authenticationDatabase '$external' --authenticationMechanism "PLAIN" --host "mongodb.example.com" --port 27017
mongosh --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 <mongo
--password>` command-line option, :mongosh:`mongosh </>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
" \
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions source/includes/fact-default-bind-ip.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion source/includes/steps-authenticate-as-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <mongosh -p>`
command-line option, :mongosh:`mongosh </>` prompts for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <mongosh -p>`
Expand Down
2 changes: 1 addition & 1 deletion source/includes/steps-configure-ldap-mongodb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ content: |

.. code-block:: bash

mongo --host <host> --authenticationMechanism PLAIN --authenticationDatabase '$external' -u <user> -p
mongosh --host <host> --authenticationMechanism PLAIN --authenticationDatabase '$external' -u <user> -p

- id: authafter
name: Authenticate after Connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ pre: |

.. code-block:: bash

mongo --username sam@DBA.EXAMPLE.COM --password --authenticationMechanism 'PLAIN' --authenticationDatabase '$external' --host <hostname> --port <port>
mongosh --username sam@DBA.EXAMPLE.COM --password --authenticationMechanism 'PLAIN' --authenticationDatabase '$external' --host <hostname> --port <port>

If you do not specify the password to the :option:`-p <mongosh
--password>` command-line option, :mongosh:`mongosh </>`
Expand Down
2 changes: 1 addition & 1 deletion source/includes/steps-connect-with-admin-privileges.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
...
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions source/includes/steps-convert-replica-set-add-new-shard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion source/includes/steps-convert-replica-set-add-shards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
Expand Down Expand Up @@ -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.

Expand All @@ -145,7 +145,7 @@ content: |

.. code-block:: bash

mongo --port 27017
mongosh --port 27017


In :mongosh:`mongosh </>`, switch to the
Expand Down Expand Up @@ -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.

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/includes/steps-csfle-shell-aws-create-key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
" \
Expand Down
2 changes: 1 addition & 1 deletion source/includes/steps-csfle-shell-azure-create-key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion source/includes/steps-csfle-shell-gcp-create-key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ content: |

.. code-block:: bash

mongo --eval "
mongosh --eval "
var GCP_EMAIL = '$GCP_EMAIL'
var GCP_PRIVATEKEY = '$GCP_PRIVATEKEY'
" \
Expand Down
2 changes: 1 addition & 1 deletion source/includes/steps-csfle-shell-local-create-key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 </>`
Expand Down
2 changes: 1 addition & 1 deletion source/includes/steps-deploy-replica-set-with-auth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <mongosh -p>`
command-line option, :mongosh:`mongosh </>` prompts for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ action:
copyable: true
language: sh
code: |
mongo --host <hostname> --port <port>
mongosh --host <hostname> --port <port>
---
stepnum: 3
title: Initiate the replica set.
Expand Down
2 changes: 1 addition & 1 deletion source/includes/steps-deploy-sharded-cluster-connect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <mongosh -p>`
command-line option, :mongosh:`mongosh </>` prompts for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ action:
copyable: true
language: sh
code: |
mongo --host <hostname> --port <port>
mongosh --host <hostname> --port <port>
---
title: Initiate the replica set.
level: 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <mongosh -p>`
command-line option, :mongosh:`mongosh </>` prompts for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pre: |

.. code-block:: javascript

mongo --username "joe" --password "<password>" \
mongosh --username "joe" --password "<password>" \
--authenticationDatabase "marketing" --host mongos1.example.net:27017

If your application uses a MongoDB driver, see the associated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pre: |

.. code-block:: bash

mongo --host <hostname> --port <port>
mongosh --host <hostname> --port <port>

If your MongoDB server currently enforces authentication, you must
authenticate to the ``admin`` database as a user with role management
Expand All @@ -108,7 +108,7 @@ pre: |

.. code-block:: bash

mongo --host <hostname> --port <port> --username <user> --password <pass> --authenticationDatabase="admin" --authenticationMechanism="<mechanism>"
mongosh --host <hostname> --port <port> --username <user> --password <pass> --authenticationDatabase="admin" --authenticationMechanism="<mechanism>"

.. note::

Expand Down Expand Up @@ -497,7 +497,7 @@ pre: |

.. code-block:: bash

mongo --username sam@DBA.EXAMPLE.COM --password --authenticationMechanisms="GSSAPI" --authenticationDatabase "$external" --host <hostname> --port <port>
mongosh --username sam@DBA.EXAMPLE.COM --password --authenticationMechanisms="GSSAPI" --authenticationDatabase "$external" --host <hostname> --port <port>

If you do not specify the password to the :option:`-p <mongosh
--password>` command-line option, :mongosh:`mongosh </>`
Expand Down
4 changes: 2 additions & 2 deletions source/includes/steps-shard-a-collection-ranged.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ action:
parameter passing the port the :binary:`~bin.mongos` listens on.
language: javascript
code: |
mongo --host <hostname> --port <port>
mongosh --host <hostname> --port <port>
- pre: |
If your cluster enforces :term:`authentication`, add the
``--username``, ``-password``, and ``--authenticationDatabase``
Expand All @@ -26,7 +26,7 @@ action:
authenticating to the ``admin`` database.
language: javascript
code: |
mongo --host <hostname> --port <port> --username <user> --password <pass> --authenticationDatabase 'admin'
mongosh --host <hostname> --port <port> --username <user> --password <pass> --authenticationDatabase 'admin'
---
title: "Enable Sharding on the Database"
level: 4
Expand Down
4 changes: 2 additions & 2 deletions source/reference/command/getLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
--------
Expand Down
6 changes: 3 additions & 3 deletions source/reference/connection-string.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ has been configured to support authentication via `AWS IAM credentials

.. code-block:: none

mongo 'mongodb+srv://<aws access key id>:<aws secret access key>@cluster0.example.com/testdb?authSource=$external&authMechanism=MONGODB-AWS'
mongosh 'mongodb+srv://<aws access key id>:<aws secret access key>@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 <authMechanism>`
Expand All @@ -1430,7 +1430,7 @@ as well, provide it with the ``AWS_SESSION_TOKEN``

.. code-block:: none

mongo 'mongodb+srv://<aws access key id>:<aws secret access key>@cluster0.example.com/testdb?authSource=$external&authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:<aws session token>'
mongosh 'mongodb+srv://<aws access key id>:<aws secret access key>@cluster0.example.com/testdb?authSource=$external&authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:<aws session token>'

.. note::

Expand Down Expand Up @@ -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'
Loading