Skip to content

Commit 41d1e5f

Browse files
authored
DOCSP-26528 Adding username and password parameters to CLI page (#452)
* DOCSP-26528 Adding username and password parameters to CLI page * codeblock * enhance * verbiage * tweak * headers * Internal Review feedback 1 * backticks * connection string abstract * cluster0 * external feedback 2
1 parent 63b2299 commit 41d1e5f

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

source/command-line-options.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ overrides the value in the :guilabel:`Settings` panel.
103103
.. option:: --protectConnectionStrings
104104

105105
Hide credentials in connection strings. Passwords in connection
106-
strings are displayed as `*****`.
106+
strings are displayed as ``*****``.
107107

108108
.. option:: --theme
109109

source/connect/connect-from-the-command-line.txt

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,47 @@ Command Line Connection Specification
3838
-------------------------------------
3939

4040
The command line invocation for |compass-short| has two components, the
41-
path to the |compass-short| executable and a connection string. The
42-
format is:
41+
path to the |compass-short| executable and a connection string. You can
42+
optionally provide the username and password on the command line or
43+
the configuration file. The format is:
4344

4445
.. code-block:: shell
4546
:copyable: false
46-
47-
<path/to/compass/executable> <connection string>
4847

49-
This example is like the basic connection string for a `MongoDB
48+
<path/to/compass/executable>
49+
<connection string>
50+
--username <username> --password <password>
51+
52+
.. note::
53+
54+
If the username and password arguments are not provided, Compass uses
55+
the credentials in the connection string.
56+
57+
58+
Basic Connection String
59+
~~~~~~~~~~~~~~~~~~~~~~~
60+
61+
The following example uses a basic connection string for a `MongoDB
5062
University <https://learn.mongodb.com/>`__ training cluster. Modify the
5163
connection details to connect to your MongoDB installation:
5264

5365
.. code-block:: shell
54-
:copyable: false
55-
56-
mongodb-compass mongodb+srv://cluster0.cpxklfq.mongodb.net/library
66+
:copyable: true
5767

68+
mongodb-compass mongodb+srv://cluster0.xxxxxx.mongodb.net/library
69+
70+
Username and Password Parameters
71+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72+
73+
This example uses the ``username`` and ``password`` parameters to
74+
authenticate Compass to the MongoDB deployment provided in the
75+
connection string:
76+
77+
.. code-block:: shell
78+
:copyable: true
79+
80+
mongodb-compass mongodb+srv://cluster0.xxxxxx.mongodb.net/library
81+
--username user1 --password password1
5882

5983
.. _compass-connect-file-based:
6084

0 commit comments

Comments
 (0)