@@ -43,8 +43,11 @@ Examples
43
43
.. tab:: Specify Template With the Command
44
44
:tabid: template-command
45
45
46
- For example, the following command uses the template to retrieve a
47
- count of the number of projects in the specified organization using the
46
+ Retrieve the Number of Projects
47
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48
+
49
+ The following command uses the template to retrieve a count of
50
+ the number of projects in the specified organization using the
48
51
{+default-profile+}:
49
52
50
53
.. code-block:: shell
@@ -57,6 +60,41 @@ Examples
57
60
:copyable: false
58
61
59
62
Count: 2
63
+
64
+ .. _quick-start-atlas-retrieve-conection-string:
65
+
66
+ Retrieve Your |service| Cluster Connection String
67
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68
+
69
+ The following :ref:`mcli-atlas-cluster-describe-command` command
70
+ uses the template to retrieve the connection string for an
71
+ |service| cluster named ``getStarted``. It uses the default
72
+ profile for accessing |service|.
73
+
74
+ .. code-block:: sh
75
+
76
+ mongocli atlas clusters describe getStarted -o go-template="Parse: {{.SrvAddress}}"
77
+
78
+ The previous command returns a string similar to the following:
79
+
80
+ .. code-block:: sh
81
+ :copyable: false
82
+
83
+ Parse: mongodb+srv://getstarted.example.mongodb.net
84
+
85
+ You can use the |mongo| shell to connect to the ``getStarted``
86
+ cluster with the ``srvAddress`` and the :manual:`connection
87
+ string
88
+ </reference/connection-string/#connection-string-options>`. This
89
+ example uses the following to connect to the |service| cluster:
90
+
91
+ - The connection string returned by the previous command
92
+ - The username and password created in this :ref:`tutorial
93
+ <mcli-quick-start-atlas>`
94
+
95
+ .. code-block::
96
+
97
+ mongo "mongodb+srv://getstarted.example.mongodb.net" --username User1 --password ChangeThisPasswordToSomethingSecure
60
98
61
99
.. tab:: Specify Template Using a File
62
100
:tabid: template-file
@@ -81,3 +119,4 @@ Examples
81
119
:copyable: false
82
120
83
121
Projects: 5e2211c17a3e5a48f5497de3 5f455b39749bea5fb575dccc
122
+
0 commit comments