From 801190917586f47341ec2233030edcc9bb8e3f8f Mon Sep 17 00:00:00 2001 From: Michael Morisi Date: Tue, 25 Feb 2025 11:55:15 -0500 Subject: [PATCH 1/3] DOCSP-46697: SRV record section --- source/connect/connection-targets.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/connect/connection-targets.txt b/source/connect/connection-targets.txt index 9ee5b932..47aca651 100644 --- a/source/connect/connection-targets.txt +++ b/source/connect/connection-targets.txt @@ -151,6 +151,20 @@ option to ``True``. You can do this in two ways: by passing an argument to the "directConnection=true") client = MongoClient(uri) +DNS Service Discovery +--------------------- + +To use DNS service discovery to look up the DNS SRV record of the service you're connecting to, +specify the SRV connection format in your connection string. The following code shows +a connection string that uses the DNS service discovery option: + +.. code-block:: python + + uri = "mongodb+srv:///" + +To learn more about the SRV connection format, see the :manual:`SRV Connection Format ` +guide in the {+mdb-server+} manual. + Troubleshooting --------------- From 740b3004b84275e14de3d8634d49e4598cb3ec4b Mon Sep 17 00:00:00 2001 From: Michael Morisi Date: Tue, 25 Feb 2025 12:02:00 -0500 Subject: [PATCH 2/3] Fix --- source/connect/connection-targets.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/connect/connection-targets.txt b/source/connect/connection-targets.txt index 47aca651..02014586 100644 --- a/source/connect/connection-targets.txt +++ b/source/connect/connection-targets.txt @@ -9,7 +9,7 @@ Choose a Connection Target :values: reference .. meta:: - :keywords: connection string, URI, server, settings, client, load balancing + :keywords: connection string, URI, server, settings, client, load balancing, srv, dns .. contents:: On this page :local: @@ -156,7 +156,7 @@ DNS Service Discovery To use DNS service discovery to look up the DNS SRV record of the service you're connecting to, specify the SRV connection format in your connection string. The following code shows -a connection string that uses the DNS service discovery option: +a connection string that uses the SRV connection format: .. code-block:: python From ec6148ebfbb4588e8b87119652414e3496aaa1f9 Mon Sep 17 00:00:00 2001 From: Michael Morisi Date: Wed, 26 Feb 2025 10:17:44 -0500 Subject: [PATCH 3/3] NR feedback --- source/connect/connection-targets.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/connect/connection-targets.txt b/source/connect/connection-targets.txt index 02014586..12de24ad 100644 --- a/source/connect/connection-targets.txt +++ b/source/connect/connection-targets.txt @@ -155,15 +155,18 @@ DNS Service Discovery --------------------- To use DNS service discovery to look up the DNS SRV record of the service you're connecting to, -specify the SRV connection format in your connection string. The following code shows -a connection string that uses the SRV connection format: +specify the SRV connection format in your connection string. Additionally, if you enable +the SRV connection format, {+driver-short+} automatically re-scans for new hosts without +having to change the client configuration. + +The following code shows a connection string that uses the SRV connection format: .. code-block:: python uri = "mongodb+srv:///" To learn more about the SRV connection format, see the :manual:`SRV Connection Format ` -guide in the {+mdb-server+} manual. +entry in the {+mdb-server+} manual. Troubleshooting ---------------