Skip to content

Commit f7aa29b

Browse files
committed
DOCSP-49972 Checking File creation for Go connection target
1 parent 9e905c7 commit f7aa29b

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

source/fundamentals/connections.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Learn how to use the {+driver-short+} to configure your application's
2828
connection to a MongoDB deployment in the following sections:
2929

3030
- :ref:`golang-connection-guide`
31+
- :ref:`golang-connection-targets`
3132
- :ref:`golang-connection-options`
3233
- :ref:`golang-network-compression`
3334
- :ref:`golang-tls`
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.. _golang-connection-targets:
2+
3+
==========================
4+
Choose a Connection Target
5+
==========================
6+
7+
Overview
8+
--------
9+
10+
In this guide, you can learn how to use a connection string and a
11+
``MongoClient`` object to connect to different types of MongoDB deployments.
12+
13+
.. tip::
14+
15+
To learn more about how to retrieve or format your connection string, see
16+
the :ref:`Connection URI <connection-guide>` guide in
17+
the Go Connection Guide.
18+
19+
Atlas
20+
-----
21+
22+
To connect to a MongoDB deployment on Atlas, include the following elements in your
23+
connection string:
24+
25+
- URL of your Atlas cluster
26+
- MongoDB username
27+
- MongoDB password
28+
29+
Then, pass your connection string to the ``MongoClient`` constructor.
30+
31+
When you connect to Atlas, we recommend using the {+stable-api+} client option to avoid
32+
breaking changes when Atlas upgrades to a new version of {+mdb-server+}.
33+
To learn more about the {+stable-api+} feature, see the :ref:`<stable-api>`
34+
guide.
35+
36+
The following code shows how to use the {+driver-short+} to connect to an Atlas cluster. The
37+
code also uses the ``server_api`` field to specify a {+stable-api+} version.
38+
39+
.. _go-connection-example-code:
40+

0 commit comments

Comments
 (0)