@@ -38,23 +38,47 @@ Command Line Connection Specification
38
38
-------------------------------------
39
39
40
40
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:
43
44
44
45
.. code-block:: shell
45
46
:copyable: false
46
-
47
- <path/to/compass/executable> <connection string>
48
47
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
50
62
University <https://learn.mongodb.com/>`__ training cluster. Modify the
51
63
connection details to connect to your MongoDB installation:
52
64
53
65
.. code-block:: shell
54
- :copyable: false
55
-
56
- mongodb-compass mongodb+srv://cluster0.cpxklfq.mongodb.net/library
66
+ :copyable: true
57
67
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
58
82
59
83
.. _compass-connect-file-based:
60
84
0 commit comments