Skip to content

Commit ca16ee5

Browse files
jocelyn-mendezJocelyn Mendez
andauthored
(DOCSP-10996) Added section to note how to connect to specific database (mongodb#22)
* (DOCSP-10996) Added section to note how to connect to specific database * (DOCSP-10996) Added section to note how to connect to specific database * (DOCSP-10996) Added section to note how to connect to specific database * (DOCSP-10996) Added section to note how to connect to specific database * (DOCSP-10996) Added section to note how to connect to specific database * (DOCSP-10996) Added section to note how to connect to specific database * (DOCSP-10996) Added section to note how to connect to specific database * (DOCSP-10996) Added section to note how to connect to specific database * (DOCSP-10996) Added section to connect to specific database Co-authored-by: Jocelyn Mendez <[email protected]>
1 parent 1cef352 commit ca16ee5

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

source/connect.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,22 @@ For ``tls`` connections:
204204

205205
mongosh "mongodb://mongodb0.example.com:28015" --tls
206206

207+
Connect to a Specific Database
208+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
209+
210+
To connect to a specific database, specify a database in your
211+
`connection string URI path
212+
<https://docs.mongodb.com/manual/reference/connection-string/>`__. If
213+
you do not specify a database in your URI path, you connect to a database named ``test``.
214+
215+
.. example::
216+
217+
The following connection string URI connects to database ``db1``.
218+
219+
.. code-block:: sh
220+
221+
mongosh "mongodb://localhost:27017/db1"
222+
207223
Connect to a Different Deployment
208224
---------------------------------
209225

0 commit comments

Comments
 (0)