Skip to content

Replace mongo options with mongosh #5554

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 13, 2021
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
3 changes: 2 additions & 1 deletion snooty.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ intersphinx = [ "https://pymongo.readthedocs.io/en/stable/objects.inv",
"https://docs.atlas.mongodb.com/objects.inv",
"https://docs.mongodb.com/php-library/master/objects.inv",
"https://docs.mongodb.com/compass/current/objects.inv",
"https://docs.mongodb.com/database-tools/objects.inv"
"https://docs.mongodb.com/database-tools/objects.inv",
"https://docs.mongodb.com/mongodb-shell/objects.inv"
]

# toc_landing_pages are pages that have pages nested beneath them
Expand Down
2 changes: 1 addition & 1 deletion source/appendix/security/appendixC-openssl-client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ B. Generate the Test PEM File for Client

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

Although still available, :option:`--ssl <mongo --ssl>` and
Although still available, :option:`--ssl <mongosh --ssl>` and
:option:`--sslCertificateSelector <mongo
--sslCertificateSelector>` are :ref:`deprecated as of MongoDB 4.2
<4.2-tls>`.
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 @@ -75,7 +75,7 @@ MongoDB Drivers

:mongosh:`mongosh </>`
To enable retryable writes in :mongosh:`mongosh </>`, use
the :option:`--retryWrites <mongo --retryWrites>` command line option:
the :option:`--retryWrites <mongosh --retryWrites>` command line option:

.. code-block:: bash

Expand Down
10 changes: 5 additions & 5 deletions source/core/security-ldap-external.txt
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,9 @@ Connecting to a MongoDB server using LDAP Authorization
When using LDAP for authorization, users connecting via
:mongosh:`mongosh </>` must:

- set :option:`--authenticationDatabase <mongo --authenticationDatabase>` to ``$external``.
- set :option:`--authenticationDatabase <mongosh --authenticationDatabase>` to ``$external``.

- set :option:`--authenticationMechanism <mongo --authenticationMechanism>` to the appropriate authentication
- set :option:`--authenticationMechanism <mongosh --authenticationMechanism>` to the appropriate authentication
mechanism.

If using :ref:`LDAP authentication <security-ldap>`, set this to ``PLAIN``.
Expand All @@ -417,13 +417,13 @@ When using LDAP for authorization, users connecting via

If using :ref:`x.509 <security-auth-x509>`, set this to ``MONGODB-X.509``.

- set :option:`--username <mongo --username>` to a username that respects the
- set :option:`--username <mongosh --username>` to a username that respects the
:setting:`security.ldap.authz.queryTemplate`, or any configured
:setting:`security.ldap.userToDNMapping` template.

- set :option:`--password <mongo --password>` to the appropriate password.
- set :option:`--password <mongosh --password>` to the appropriate password.

Include the :option:`--host <mongo --host>` and :option:`--port <mongo --port>` of the MongoDB server,
Include the :option:`--host <mongo --host>` and :option:`--port <mongosh --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
Expand Down
16 changes: 8 additions & 8 deletions source/core/security-x.509.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ To connect and authenticate using x.509 client certificate:

- For MongoDB 4.2 or greater, include the following options for the client:

- :option:`--tls <mongo --tls>` (or the deprecated :option:`--ssl
- :option:`--tls <mongosh --tls>` (or the deprecated :option:`--ssl
<mongo --ssl>` option)

- :option:`--tlsCertificateKeyFile <mongo --tlsCertificateKeyFile>`
- :option:`--tlsCertificateKeyFile <mongosh --tlsCertificateKeyFile>`
(or the deprecated :option:`--sslPEMKeyFile
<mongo --sslPEMKeyFile>` option)

- :option:`--tlsCertificateKeyFilePassword <mongo --tlsCertificateKeyFile>`
- :option:`--tlsCertificateKeyFilePassword <mongosh --tlsCertificateKeyFile>`
(or the deprecated :option:`--sslPEMKeyPassword
<mongo --sslPEMKeyPassword>` option) if the certificate key file is encrypted

Expand All @@ -84,17 +84,17 @@ To connect and authenticate using x.509 client certificate:

- For MongoDB 4.0 and earlier, include the following options for the client:

- :option:`--ssl <mongo --ssl>`
- :option:`--ssl <mongosh --ssl>`

- :option:`--sslPEMKeyFile <mongo --sslPEMKeyFile>`
- :option:`--sslPEMKeyFile <mongosh --sslPEMKeyFile>`

- :option:`--sslPEMKeyPassword <mongo --sslPEMKeyPassword>` option if
the :option:`--sslPEMKeyFile <mongo --sslPEMKeyFile>` is encrypted.
- :option:`--sslPEMKeyPassword <mongosh --sslPEMKeyPassword>` option if
the :option:`--sslPEMKeyFile <mongosh --sslPEMKeyFile>` is encrypted.

- :option:`--authenticationDatabase '$external'
<mongo --authenticationDatabase>`

- :option:`--authenticationMechanism MONGODB-X509 <mongo --authenticationMechanism>`
- :option:`--authenticationMechanism MONGODB-X509 <mongosh --authenticationMechanism>`

You can also make the TLS/SSL connection first, and then use
:method:`db.auth()` in the ``$external`` database to authenticate.
Expand Down
6 changes: 3 additions & 3 deletions source/core/sharded-cluster-query-router.txt
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ server>`, with the :option:`--auth <mongod --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 <mongo --username>`,
:option:`--password <mongo --password>`, and
:option:`--authenticationDatabase <mongo --authenticationDatabase>` when
With RBAC enforced, clients must specify a :option:`--username <mongosh --username>`,
:option:`--password <mongosh --password>`, and
:option:`--authenticationDatabase <mongosh --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
Expand Down
2 changes: 1 addition & 1 deletion source/includes/extracts-ssl-facts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ ref: ssl-facts-mongo-ssl-hostname-verification
content: |

:mongosh:`mongosh </>` verifies that the hostname (specified
in :option:`--host <mongo --host>` option or the connection string)
in :option:`--host <mongosh --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, :mongosh:`mongosh </>`
Expand Down
6 changes: 3 additions & 3 deletions source/includes/fact-authenticate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ associated with that user.
To authenticate using :mongosh:`mongosh </>`, either:

- Use the :mongosh:`mongosh </>` command-line authentication options
(:option:`--username <mongo --username>`,
:option:`--password <mongo --password>`, and
:option:`--authenticationDatabase <mongo --authenticationDatabase>`)
(:option:`--username <mongosh --username>`,
:option:`--password <mongosh --password>`, and
:option:`--authenticationDatabase <mongosh --authenticationDatabase>`)
when connecting to the :binary:`~bin.mongod` or
:binary:`~bin.mongos` instance, or

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,12 @@ pre: |
Use :mongosh:`mongosh </>` to authenticate to the MongoDB
server, set the following options:

- :option:`--host <mongo --host>` with the hostname of the MongoDB server
- :option:`--port <mongo --port>` with the port of the MongoDB server
- :option:`--username <mongo --username>` to the user's username
- :option:`--password <mongo --password>` to the user's password
- :option:`--authenticationMechanism <mongo --authenticationMechanism>` to ``'PLAIN'``
- :option:`--authenticationDatabase <mongo --authenticationDatabase>` to ``'$external'``
- :option:`--host <mongosh --host>` with the hostname of the MongoDB server
- :option:`--port <mongosh --port>` with the port of the MongoDB server
- :option:`--username <mongosh --username>` to the user's username
- :option:`--password <mongosh --password>` to the user's password
- :option:`--authenticationMechanism <mongosh --authenticationMechanism>` to ``'PLAIN'``
- :option:`--authenticationDatabase <mongosh --authenticationDatabase>` to ``'$external'``

.. example::

Expand Down Expand Up @@ -317,7 +317,7 @@ pre: |
.. note::

If you want to authenticate as an existing non-``$external`` user, set
:option:`--authenticationMechanism <mongo --authenticationMechanism>` to SCRAM authentication mechanism (e.g. ``SCRAM-SHA-1`` or ``SCRAM-SHA-256`` as appropriate). This requires
:option:`--authenticationMechanism <mongosh --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``.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <mongo --gssapiHostName>`
match the Kerberos name, use :option:`--gssapiHostName <mongosh --gssapiHostName>`
to specify the Kerberos FQDN that it responds to.
- pre: |
Alternatively, you can first connect :binary:`mongo.exe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,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 <mongo --gssapiHostName>`
match the Kerberos name, use :option:`--gssapiHostName <mongosh --gssapiHostName>`
to specify the Kerberos FQDN that it responds to.
- pre: |
Alternatively, you can first connect :mongosh:`mongosh </>` to the
Expand Down
4 changes: 2 additions & 2 deletions source/includes/steps-csfle-shell-aws-create-key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ content: |
- ``AWS_SECRET_ACCESS_KEY``

Next, create :mongosh:`mongosh </>` session using the
:option:`--eval <mongo --eval>`, :option:`--shell <mongo --shell>`,
and :option:`--nodb <mongo --nodb>` options:
:option:`--eval <mongo --eval>`, :option:`--shell <mongosh --shell>`,
and :option:`--nodb <mongosh --nodb>` options:

.. code-block:: bash

Expand Down
4 changes: 2 additions & 2 deletions source/includes/steps-csfle-shell-azure-create-key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ content: |
- ``AZURE_CLIENT_SECRET``

Next, create a :mongosh:`mongosh </>` session using the
:option:`--eval <mongo --eval>`, :option:`--shell <mongo --shell>`,
and :option:`--nodb <mongo --nodb>` options:
:option:`--eval <mongo --eval>`, :option:`--shell <mongosh --shell>`,
and :option:`--nodb <mongosh --nodb>` options:

.. code-block:: bash

Expand Down
4 changes: 2 additions & 2 deletions source/includes/steps-csfle-shell-gcp-create-key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ content: |
- ``GCP_PRIVATEKEY``

Next, create a :mongosh:`mongosh </>` session using the
:option:`--eval <mongo --eval>`, :option:`--shell <mongo --shell>`,
and :option:`--nodb <mongo --nodb>` options:
:option:`--eval <mongo --eval>`, :option:`--shell <mongosh --shell>`,
and :option:`--nodb <mongosh --nodb>` options:

.. code-block:: bash

Expand Down
4 changes: 2 additions & 2 deletions source/includes/steps-csfle-shell-local-create-key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ level: 4
content: |

Create a :mongosh:`mongosh </>` session using the :option:`--eval
<mongo --eval>`, :option:`--shell <mongo --shell>`, and
:option:`--nodb <mongo --nodb>` options:
<mongo --eval>`, :option:`--shell <mongosh --shell>`, and
:option:`--nodb <mongosh --nodb>` options:

.. code-block:: bash

Expand Down
18 changes: 9 additions & 9 deletions source/includes/steps-kerberos-auth-activedirectory-authz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ level: 4
pre: |

Connect to the MongoDB server using :mongosh:`mongosh </>` using the
:option:`--host <mongo --host>` and :option:`--port <mongo --port>` options.
:option:`--host <mongo --host>` and :option:`--port <mongosh --port>` options.

.. code-block:: bash

Expand All @@ -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 <mongo --authenticationMechanism>` for the
:option:`--authenticationMechanism <mongosh --authenticationMechanism>` for the
MongoDB server's configured authentication mechanism.

.. code-block:: bash
Expand Down Expand Up @@ -479,12 +479,12 @@ pre: |
Use :mongosh:`mongosh </>` to authenticate to the MongoDB
server, set the following options:

- :option:`--host <mongo --host>` with the hostname of the MongoDB server
- :option:`--port <mongo --port>` with the port of the MongoDB server
- :option:`--username <mongo --username>` to the user's ``userPrincipalName``
- :option:`--password <mongo --password>` to the user's password (or omit to have :mongosh:`mongosh </>` prompt for the password)
- :option:`--authenticationMechanism <mongo --authenticationMechanism>` to ``"GSSAPI"``
- :option:`--authenticationDatabase <mongo --authenticationDatabase>` to ``"$external"``
- :option:`--host <mongosh --host>` with the hostname of the MongoDB server
- :option:`--port <mongosh --port>` with the port of the MongoDB server
- :option:`--username <mongosh --username>` to the user's ``userPrincipalName``
- :option:`--password <mongosh --password>` to the user's password (or omit to have :mongosh:`mongosh </>` prompt for the password)
- :option:`--authenticationMechanism <mongosh --authenticationMechanism>` to ``"GSSAPI"``
- :option:`--authenticationDatabase <mongosh --authenticationDatabase>` to ``"$external"``

.. example::

Expand Down Expand Up @@ -513,7 +513,7 @@ pre: |
.. note::

If you want to authenticate as an existing non-``$external`` user, set
:option:`--authenticationMechanism <mongo --authenticationMechanism>` to a SCRAM authentication mechanism (e.g. ``SCRAM-SHA-1`` or ``SCRAM-SHA-256``). This requires
:option:`--authenticationMechanism <mongosh --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.
---
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 @@ -142,7 +142,7 @@ Outside ``mongosh`` with ``jq``
.. include:: /includes/fact-use-jq-with-structured-logging.rst

To use ``jq`` with :dbcommand:`getLog` output, you must use the
:option:`--eval <mongo --eval>` option to :mongosh:`mongosh </>`.
:option:`--eval <mongosh --eval>` option to :mongosh:`mongosh </>`.
The following operation uses ``jq`` to filter on the **REPL**
:ref:`component <log-message-components>` to present only those log
messages associated with replication:
Expand All @@ -153,7 +153,7 @@ messages associated with replication:

Be sure to provide any necessary connection-specific parameters to
:mongosh:`mongosh </>` as needed, such as :option:`--host
<mongo --host>` or :option:`--port <mongo --port>`.
<mongo --host>` or :option:`--port <mongosh --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
Expand Down
2 changes: 1 addition & 1 deletion source/reference/command/shutdown.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ 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 :mongosh:`mongosh </>` with
the :option:`--host "127.0.0.1" <mongo --host>` option on the
the :option:`--host "127.0.0.1" <mongosh --host>` option on the
same host machine as the :binary:`~bin.mongod`.

.. _cmd-shutdown-replica-set:
Expand Down
4 changes: 2 additions & 2 deletions source/reference/connection-string.txt
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ Alternatively, you can also use the equivalent :urioption:`ssl=true

If the :binary:`mongo` shell specifies additional
:ref:`tls/ssl <mongo-shell-tls>` options from the
command-line, use the :option:`--tls <mongo --tls>`
command-line, use the :option:`--tls <mongosh --tls>`
command-line option instead.

.. versionadded:: 4.2
Expand All @@ -449,7 +449,7 @@ Alternatively, you can also use the equivalent :urioption:`ssl=true

If the :binary:`mongo` shell specifies additional
:ref:`tls/ssl <mongo-shell-ssl>` options from the
command-line, use the :option:`--ssl <mongo --ssl>`
command-line, use the :option:`--ssl <mongosh --ssl>`
command-line option instead.

* - .. urioption:: tlsCertificateKeyFile
Expand Down
2 changes: 1 addition & 1 deletion source/reference/method/Mongo.startSession.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Definition
encountering transient network errors.

If you start :mongosh:`mongosh </>` with the
:option:`--retryWrites <mongo --retryWrites>` option, ``retryWrites`` is enabled by
:option:`--retryWrites <mongosh --retryWrites>` option, ``retryWrites`` is enabled by
default for :method:`Mongo.startSession()`.

After starting a session, you cannot modify its
Expand Down
2 changes: 1 addition & 1 deletion source/reference/method/SessionOptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Definition
failovers.

To enable retry writes, start :mongosh:`mongosh </>`
with the :option:`--retryWrites <mongo --retryWrites>` option.
with the :option:`--retryWrites <mongosh --retryWrites>` option.

You can view whether ``retryWrites`` is enabled for a session
via the following method:
Expand Down
6 changes: 3 additions & 3 deletions source/reference/method/db.auth.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ Authenticate when Connecting to the Shell
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Alternatively, you can use :mongosh:`mongosh </>`'s
command-line options :option:`--username <mongo --username>`,
:option:`--password <mongo --password>`,
:option:`--authenticationDatabase <mongo --authenticationDatabase>`,
command-line options :option:`--username <mongosh --username>`,
:option:`--password <mongosh --password>`,
:option:`--authenticationDatabase <mongosh --authenticationDatabase>`,
and :option:`--authenticationMechanism <mongo
--authenticationMechanism>` to specify authentication credentials when
connecting :mongosh:`mongosh </>`:
Expand Down
2 changes: 1 addition & 1 deletion source/reference/method/db.shutdownServer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ 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 :mongosh:`mongosh </>` with the
:option:`--host "127.0.0.1" <mongo --host>` option on the same host
:option:`--host "127.0.0.1" <mongosh --host>` option on the same host
machine as the :binary:`~bin.mongod`.

.. _method-shutdown-replica-set:
Expand Down
2 changes: 1 addition & 1 deletion source/reference/program/mongo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ Connect to a Replica Set Using the DNS Seedlist Connection Format
.. versionadded:: 3.6

To connect to a replica set described using the
:ref:`connections-dns-seedlist`, use the :option:`--host <mongo --host>` option
:ref:`connections-dns-seedlist`, use the :option:`--host <mongosh --host>` option
to specify the connection string to the :binary:`~bin.mongo` shell. In
the following example, the DNS configuration resembles:

Expand Down
Loading