@@ -24,10 +24,10 @@ To connect to a MongoDB deployment, you need two things:
24
24
25
25
- A **connection URI**, also known as a *connection string*, which tells the {+driver-short+}
26
26
which MongoDB deployment to connect to.
27
- - A **MongoClient** object, which creates the connection to and perform
27
+ - A **MongoClient** object, which creates the connection to and performs
28
28
operations on the MongoDB deployment.
29
29
30
- You can also use either of these components to customize the way the {+driver-short+} behaves
30
+ You can also use ``MongoClientSettings`` to customize the way the {+driver-short+} behaves
31
31
while connected to MongoDB.
32
32
33
33
This guide shows you how to create a connection string and use a ``MongoClient`` object
@@ -40,8 +40,8 @@ Connection URI
40
40
41
41
A standard connection string includes the following components:
42
42
43
- .. TODO, add this as last sentence for ``username:password`` description: For more information about the ``authSource``
44
- .. connection option, see :ref:`kotlin-sync-auth`.
43
+ .. TODO, add this as last sentence for ``username:password`` description once a kotlin auth page is made:
44
+ .. For more information about the ``authSource`` connection option, see :ref:`kotlin-sync-auth`.
45
45
46
46
.. list-table::
47
47
:widths: 20 80
@@ -87,7 +87,18 @@ Atlas Connection Example
87
87
------------------------
88
88
89
89
To connect to a MongoDB deployment on Atlas, you must first create a client.
90
- You can create a client with your desired configurations by passing a
90
+
91
+ You can pass a connection URI as a string to ``MongoClient.create()`` to connect
92
+ to a MongoDB instance:
93
+
94
+ .. literalinclude:: /includes/connect/mongoclient2.kt
95
+ :start-after: start-connect-to-atlas-w-uri
96
+ :end-before: end-connect-to-atlas-w-uri
97
+ :language: kotlin
98
+ :copyable:
99
+ :dedent:
100
+
101
+ You can also create a client with your desired configurations by passing a
91
102
``MongoClientSettings`` object to the ``MongoClient.create()`` method.
92
103
93
104
To instantiate a ``MongoClientSettings`` object, use the builder method to
0 commit comments