Skip to content

Commit c5e3e69

Browse files
Merge pull request #73 from ianf-mongodb/DOCSP-34766-b
DOCSP-34766 Improve VSCode Connection Experience
2 parents 7f42509 + 72eb58f commit c5e3e69

11 files changed

+354
-157
lines changed

source/connect.txt

Lines changed: 168 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -58,88 +58,51 @@ Considerations
5858

5959
.. _vsce-connect-task:
6060

61-
Create a Connection to a Deployment
62-
-----------------------------------
61+
Create a Connection
62+
-------------------
63+
64+
|vsce| provides two options to connect to your deployment:
65+
66+
.. list-table::
67+
:header-rows: 1
68+
:widths: 20 40
6369

64-
|vsce| provides two methods to create a connection to a deployment. You
65-
can:
70+
* - Connection Method
71+
- Description
6672

67-
- Provide a deployment connection string, or
68-
- Fill in a deployment information in specific fields.
73+
* - :guilabel:`Connect with Connection String`
74+
- This method is faster and easier than
75+
using the advanced connection settings. Use this option
76+
if your deployment is hosted on |service| or you already have a
77+
connection string for a deployment available.
6978

70-
Providing a connection string is faster and easier than filling in a
71-
deployment's details. Use this option if |service| hosts your
72-
deployment or if you have a connection string for a deployment
73-
available.
79+
* - :guilabel:`Advanced Connection Settings`
80+
- This method lets you build a connection string with a form.
81+
Use this option if you need to customize the connection
82+
string and want to see available connection options.
7483

75-
Define how your connection is saved with the
76-
:guilabel:`Default Connection Saving Location`
77-
:ref:`setting <vsce-settings>`:
84+
.. note::
7885

79-
.. include:: includes/connection-location-table.rst
86+
To specify where |vsce| connections are saved, use
87+
the :guilabel:`Default Connection Saving Location`
88+
:ref:`setting <vsce-settings>`.
8089

8190
.. tabs::
8291

83-
.. tab:: Paste Connection String
84-
:tabid: paste-connection-string
92+
.. tab:: Connect with Connection String
93+
:tabid: connect-with-connection-string
8594

8695
When you provide a connection string, |vsce| supports
8796
most :manual:`Connection String Options
8897
</reference/connection-string/#connection-string-options>`
8998
supported by MongoDB.
9099

91-
.. include:: /includes/steps/starting-vsce-paste-string.rst
92-
93-
.. tab:: Fill in Individual Fields
94-
:tabid: individual-fields
95-
96-
.. include:: /includes/steps/starting-vsce-individual-fields.rst
97-
98-
.. _vsce-activate-connection:
99-
100-
Activate a Connection
101-
---------------------
102-
103-
You can connect |vsce| to only one deployment at a time. To change the
104-
active connection to a different deployment, or to connect to a
105-
deployment from which you were disconnected:
106-
107-
.. include:: /includes/steps/activate-connection.rst
108-
109-
Launch MongoDB Shell
110-
~~~~~~~~~~~~~~~~~~~~
111-
112-
You can connect the :mongosh:`MongoDB Shell </>` or legacy
113-
:binary:`mongo <mongo>` shell to your active deployment.
114-
115-
116-
Considerations
117-
``````````````
118-
119-
- The shell that |vsce| uses to connect to your deployment is
120-
determined by the :guilabel:`Shell` setting in your
121-
:ref:`extension settings <vsce-settings>`. You can choose either
122-
the :mongosh:`MongoDB Shell </>` or the legacy :binary:`mongo <mongo>` shell.
100+
.. include:: /includes/steps/starting-vsce-connect-with-connection-string.rst
123101

124-
- The path to your selected shell must exist in your system's ``PATH``.
125-
If it does not exist in your ``PATH``, the operation errors.
102+
.. tab:: Advanced Connection Settings
103+
:tabid: Advanced Connection Settings
126104

127-
Procedure
128-
`````````
129-
130-
To connect the shell to your active deployment:
131-
132-
1. In the |vsce| :guilabel:`Connections` list, right-click your active
133-
deployment.
134-
135-
#. Select :guilabel:`Launch MongoDB Shell`.
136-
137-
|vsce| opens the :guilabel:`Terminal` window in VS Code and launches
138-
the shell connected to your selected deployment.
139-
140-
.. seealso::
141-
142-
:mongosh:`Perform CRUD Operations in the MongoDB Shell </crud>`
105+
.. include:: /includes/steps/starting-vsce-connect-with-advanced-connection-settings.rst
143106

144107

145108
.. _vsce-connect-task-atlas-streams:
@@ -207,6 +170,129 @@ For details on how to configure Atlas Stream Processing, see
207170
:figwidth: 700px
208171
:alt: Image of a stream processing template
209172

173+
.. _vsce-activate-connection:
174+
175+
Activate a Connection
176+
---------------------
177+
178+
You can connect |vsce| to only one deployment at a time. To change the
179+
active connection to a different deployment, or to connect to a
180+
deployment from which you were disconnected:
181+
182+
.. include:: /includes/steps/activate-connection.rst
183+
184+
Launch MongoDB Shell
185+
~~~~~~~~~~~~~~~~~~~~
186+
187+
You can connect the :mongosh:`MongoDB Shell </>` or legacy
188+
:binary:`mongo <mongo>` shell to your active deployment.
189+
190+
191+
Considerations
192+
``````````````
193+
194+
- The shell that |vsce| uses to connect to your deployment is
195+
determined by the :guilabel:`Shell` setting in your
196+
:ref:`extension settings <vsce-settings>`. You can choose either
197+
the :mongosh:`MongoDB Shell </>` or the legacy :binary:`mongo <mongo>` shell.
198+
199+
- The path to your selected shell must exist in your system's ``PATH``.
200+
If it does not exist in your ``PATH``, the operation errors.
201+
202+
Procedure
203+
`````````
204+
205+
To connect the shell to your active deployment:
206+
207+
a. In the |vsce| :guilabel:`Connections` list, right-click your active
208+
deployment.
209+
210+
#. Select :guilabel:`Launch MongoDB Shell`.
211+
212+
|vsce| opens the :guilabel:`Terminal` window in VS Code and launches
213+
the shell connected to your selected deployment.
214+
215+
.. seealso::
216+
217+
:mongosh:`Perform CRUD Operations in the MongoDB Shell </crud>`
218+
219+
.. _vsce-edit-connection-task:
220+
221+
Edit a Connection
222+
-----------------
223+
224+
.. procedure::
225+
:style: normal
226+
227+
228+
.. step:: In |vscode-short|, click the :guilabel:`MongoDB` icon in the :guilabel:`Activity Bar`
229+
230+
.. figure:: /images/vsce-mongodb-extension-sidemenu.png
231+
:figwidth: 600px
232+
:alt: Image VSCode side bar menu.
233+
234+
.. step:: Expand the :guilabel:`Connections` pane
235+
236+
Expand the :guilabel:`Connections` pane in the left
237+
navigation if it's collapsed.
238+
239+
.. figure:: /images/vsce-expand-connections.png
240+
:figwidth: 600px
241+
:alt: Image showing connections pane
242+
243+
.. step:: Select a connection
244+
245+
From the :guilabel:`Connections` menu, right-click the
246+
connection and select :guilabel:`Edit Connection...`
247+
248+
.. step:: Make changes and save
249+
250+
Click :icon-fa5:`chevron-right`
251+
:guilabel:`Advanced Connection Options` to display
252+
the advanced connection form.
253+
254+
.. tip::
255+
256+
You can also click the :guilabel:`Edit Connection String`
257+
toggle in the top-right of the form to edit the connection
258+
string URI directly.
259+
260+
Once you are done editing the connection options click
261+
:guilabel:`Save & Connect`.
262+
263+
.. _vsce-copy-connection-string-task:
264+
265+
Copy a Connection
266+
-----------------
267+
268+
You can copy a connection string from an existing |vscode-short|
269+
connection.
270+
271+
.. procedure::
272+
:style: normal
273+
274+
.. step:: In |vscode-short|, click the :guilabel:`MongoDB` icon in the :guilabel:`Activity Bar`
275+
276+
.. figure:: /images/vsce-mongodb-extension-sidemenu.png
277+
:figwidth: 600px
278+
:alt: Image VSCode side bar menu.
279+
280+
.. step:: Expand the :guilabel:`Connections` pane
281+
282+
Expand the :guilabel:`Connections` pane in the left
283+
navigation if it's collapsed.
284+
285+
.. figure:: /images/vsce-expand-connections.png
286+
:figwidth: 600px
287+
:alt: Image showing connections pane
288+
289+
.. step:: Select a connection
290+
291+
From the :guilabel:`Connections` menu, right-click the
292+
connection and select :guilabel:`Copy Connection String`.
293+
294+
The connection string is copied to your clipboard.
295+
210296
.. _vsce-rename-connection:
211297

212298
Rename a Connection
@@ -223,35 +309,37 @@ Disconnect from a Deployment
223309

224310
|vsce| provides two methods to disconnect from a deployment. You can:
225311

226-
- Disconnect with the Command Palette, or
312+
- Disconnect with the Command Palette.
227313
- Disconnect from the :guilabel:`MongoDB` view in the
228314
:guilabel:`Activity Bar`.
229315

230316
.. tabs::
231317

232-
.. tab:: Disconnect with the Command Palette
233-
:tabid: command-palette
234-
235-
.. include:: /includes/steps/disconnect-command-palette.rst
236-
237-
.. tab:: Disconnect from the MongoDB View
318+
.. tab:: MongoDB View
238319
:tabid: mdb-view
239320

240321
.. include:: /includes/steps/disconnect-mongodb-view.rst
241322

323+
.. tab:: Command Palette
324+
:tabid: command-palette
325+
326+
.. include:: /includes/steps/disconnect-command-palette.rst
327+
242328
Disconnecting from a MongoDB instance closes the |vsce| connection to
243329
the active instance. You must :ref:`reconnect <vsce-connect-task>` to
244330
interact with data in your deployment again.
245331

332+
.. _vsce-remove-connection-task:
333+
246334
Remove a Connection
247335
-------------------
248336

249337
|vsce| provides two methods to remove a connection to a deployment from
250338
|vscode-short|. You can:
251339

252-
- Remove a connection with the Command Palette, or
253340
- Remove a connection from the :guilabel:`MongoDB` view in the
254341
:guilabel:`Activity Bar`.
342+
- Remove a connection with the Command Palette.
255343

256344
.. important::
257345

@@ -260,16 +348,16 @@ Remove a Connection
260348

261349
.. tabs::
262350

263-
.. tab:: Remove Connection with the Command Palette
264-
:tabid: command-palette
265-
266-
.. include:: /includes/steps/remove-connection-command-palette.rst
267-
268-
.. tab:: Remove Connection from the MongoDB View
351+
.. tab:: MongoDB View
269352
:tabid: mdb-view
270353

271354
.. include:: /includes/steps/remove-connection-mdb-view.rst
272355

356+
.. tab:: Command Palette
357+
:tabid: command-palette
358+
359+
.. include:: /includes/steps/remove-connection-command-palette.rst
360+
273361
.. seealso::
274362

275363
:ref:`playground-connect-to-deployment`
54.6 KB
Loading
11.4 KB
Loading
Loading
Loading

source/includes/steps-activate-connection.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source:
44
file: steps-open-mongodb-view.yaml
55
ref: open-mongodb-view
66
---
7-
title: "Right-click the connection you want to activate, then click :guilabel:`Connect`."
7+
title: "Right-click the connection you want to activate, then click :guilabel:`Connect`"
88
level: 4
99
ref: activate-connection
1010
...

source/includes/steps-disconnect-command-palette.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ source:
44
ref: vsce-command-palette
55
ref: vsce-connect-command-palette
66
---
7-
title: Disconnect.
7+
title: Disconnect
88
level: 4
99
ref: vsce-disconnect
1010
content: |
1111
12-
#. From the Command Palette, select
12+
a. From the Command Palette, select
1313
:guilabel:`MongoDB: Disconnect`.
1414
1515
.. include:: /includes/admonitions/tip-mongodb-command-palette.rst
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
---
2-
title: "In |vscode-short|, click the :guilabel:`MongoDB` view in the :guilabel:`Activity Bar`."
2+
title: "In |vscode-short|, click the :guilabel:`MongoDB` icon in the :guilabel:`Activity Bar`"
33
level: 4
44
ref: open-mongodb-view
5+
content: |
6+
7+
.. figure:: /images/vsce-mongodb-extension-sidemenu.png
8+
:figwidth: 600px
9+
:alt: Image VSCode side bar menu.
10+
511
...

source/includes/steps-source-command-palette.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: "In |vscode-short|, open the Command Palette."
2+
title: "Open the Command Palette"
33
level: 4
44
ref: vsce-command-palette
55
content: |
66
77
.. include:: /includes/list-tables/command-palette-options.rst
88
---
99
title: "From the Command Palette, choose where you want to save the
10-
connection."
10+
connection"
1111
level: 4
1212
ref: vsce-connect-save
1313
content: |

0 commit comments

Comments
 (0)