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
Hostnames returned from an SRV lookup must share the service name's
parent domain, and SSL is turned on with mongodb+srv URIs by default.
At most one TXT record is allowed, only "replicaSet" and "authSource"
may be set from a TXT record.
Copy file name to clipboardExpand all lines: doc/mongoc_uri_t.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -70,11 +70,11 @@ You would use a connection string that resembles the following.
70
70
SRV Example
71
71
-----------
72
72
73
-
If you have configured an `SRV record <https://www.ietf.org/rfc/rfc2782.txt>`_ with a name like "_mongodb._tcp.example.com" whose records are a list of one or more MongoDB server hostnames, use a connection string like this:
73
+
If you have configured an `SRV record <https://www.ietf.org/rfc/rfc2782.txt>`_ with a name like "_mongodb._tcp.server.example.com" whose records are a list of one or more MongoDB server hostnames, use a connection string like this:
74
74
75
75
.. code-block:: c
76
76
77
-
uri = mongoc_uri_new ("mongodb+srv://example.com/?replicaSet=rs&appName=applicationName");
77
+
uri = mongoc_uri_new ("mongodb+srv://server.example.com/?replicaSet=rs&appName=applicationName");
78
78
79
79
The driver prefixes the service name with "_mongodb._tcp.", then performs a DNS SRV query to resolve the service name to one or more hostnames. If this query succeeds, the driver performs a DNS TXT query on the service name (without the "_mongodb._tcp" prefix) for additional URI options configured as TXT records.
0 commit comments