You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/connect/connection-targets.txt
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -151,6 +151,20 @@ option to ``True``. You can do this in two ways: by passing an argument to the
151
151
"directConnection=true")
152
152
client = MongoClient(uri)
153
153
154
+
DNS Service Discovery
155
+
---------------------
156
+
157
+
To use DNS service discovery to look up the DNS SRV record of the service you're connecting to,
158
+
specify the SRV connection format in your connection string. The following code shows
159
+
a connection string that uses the DNS service discovery option:
160
+
161
+
.. code-block:: python
162
+
163
+
uri = "mongodb+srv://<hostname>/"
164
+
165
+
To learn more about the SRV connection format, see the :manual:`SRV Connection Format </reference/connection-string/#std-label-connections-dns-seedlist>`
0 commit comments