@@ -88,6 +88,13 @@ Create a Client to Connect to MongoDB Atlas
88
88
To connect to MongoDB, you must create a client. A client manages your
89
89
connections and runs database commands.
90
90
91
+ You can create a client that uses your connection string and other client
92
+ options by passing a ``ClientOptions`` object to the ``Connect()`` method.
93
+
94
+ To specify your connection URI, pass it to the ``ApplyURI()`` method, which
95
+ returns a new ``ClientOptions`` instance. To set any other options, call the
96
+ relevant helper method from the options package.
97
+
91
98
.. tip:: Reuse Your Client
92
99
93
100
We recommend that you reuse your client across sessions and operations. You
@@ -97,13 +104,6 @@ connections and runs database commands.
97
104
about how connection pools work in the driver, see the
98
105
:ref:`golang-connection-pools` guide.
99
106
100
- You can create a client that uses your connection string and other client
101
- options by passing a ``ClientOptions`` object to the ``Connect()`` method.
102
-
103
- To specify your connection URI, pass it to the ``ApplyURI()`` method, which
104
- returns a new ``ClientOptions`` instance. To set any other options, call the
105
- relevant helper method from the options package.
106
-
107
107
To learn more about connection options, see the :ref:`Connection Options
108
108
<golang-connection-options>` section. To learn more about creating a client, see
109
109
the API documentation for `Client <{+api+}/mongo#Client>`__ and `Connect()
@@ -119,7 +119,7 @@ Example
119
119
~~~~~~~
120
120
121
121
The following code shows how you can create a client that uses an Atlas
122
- connection string and the {+stable-api+} version, connect to MongoDB, and verify
122
+ connection string and the {+stable-api+} version, connects to MongoDB, and verifies
123
123
that the connection is successful:
124
124
125
125
.. literalinclude:: /includes/fundamentals/code-snippets/srv.go
0 commit comments