Skip to content

Commit 2b94710

Browse files
schmallisokay-kim
authored andcommitted
minor: paragraph wrapping
1 parent cefa79c commit 2b94710

File tree

1 file changed

+37
-32
lines changed

1 file changed

+37
-32
lines changed

source/reference/connection-string.txt

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -140,26 +140,27 @@ DNS Seedlist Connection Format
140140

141141
.. versionadded:: 3.6
142142

143-
In addition to the standard connection format, MongoDB supports a DNS-constructed
144-
seedlist. Using DNS to construct the available servers list allows more flexibility
145-
of deployment and the ability to change the servers in rotation without reconfiguring
146-
clients.
143+
In addition to the standard connection format, MongoDB supports a
144+
DNS-constructed seedlist. Using DNS to construct the available servers
145+
list allows more flexibility of deployment and the ability to change the
146+
servers in rotation without reconfiguring clients.
147147

148-
In order to leverage the DNS seedlist, use a connection string prefix of ``mongodb+srv:``
149-
in place of the ``mongodb:`` string above.
148+
In order to leverage the DNS seedlist, use a connection string prefix of
149+
``mongodb+srv:`` in place of the ``mongodb:`` string above.
150150

151-
The ``+srv`` indicates to the mongo client that the hostname that follows corresponds to a
152-
DNS SRV record. The client driver will then query the DNS for the record to determine the hosts that
153-
are running the mongod instances.
151+
The ``+srv`` indicates to the mongo client that the hostname that
152+
follows corresponds to a DNS SRV record. The client driver will then
153+
query the DNS for the record to determine the hosts that are running the
154+
mongod instances.
154155

155156
For example, to connect to a DNS-listed hostname:
156157

157158
.. code-block:: none
158159

159160
mongodb+srv://server.example.com/
160161

161-
A typical DNS configuration for the connection string above might look something
162-
like this:
162+
A typical DNS configuration for the connection string above might look
163+
something like this:
163164

164165
.. code-block:: none
165166

@@ -168,18 +169,19 @@ like this:
168169
_mongodb._tcp.server.example.com. 86400 IN SRV 0 5 27017 mongodb2.example.com.
169170

170171
.. note::
171-
The hostnames returned in SRV records must share the same parent domain (in this example, ``example.com``)
172-
as the given hostname.
172+
The hostnames returned in SRV records must share the same parent
173+
domain (in this example, ``example.com``) as the given hostname.
173174

174-
The DNS seedlist connection string can also provide options as a query string, with a trailing "/?" as in
175-
the standard connection string above. However, the ``+srv`` appended to the standard connection string
176-
signals the driver to query the DNS for options as a configured TXT record.
175+
The DNS seedlist connection string can also provide options as a query
176+
string, with a trailing "/?" as in the standard connection string above.
177+
However, the ``+srv`` appended to the standard connection string signals
178+
the driver to query the DNS for options as a configured TXT record.
177179

178-
Only two options are available for configuration via a TXT record --
179-
``replicaSet`` and ``authSource``, and only one TXT record
180-
is allowed per server. If multiple TXT records appear in the DNS and/or if the TXT record contains
181-
an option other than ``replicaSet`` or ``authSource``, an error will be thrown by the
182-
driver.
180+
Only two options are available for configuration via a TXT record:
181+
``replicaSet`` and ``authSource``, and only one TXT record is allowed
182+
per server. If multiple TXT records appear in the DNS and/or if the TXT
183+
record contains an option other than ``replicaSet`` or ``authSource``,
184+
an error will be thrown by the driver.
183185

184186
An example of a properly configured TXT record:
185187

@@ -188,33 +190,36 @@ An example of a properly configured TXT record:
188190
Record TTL Class Text
189191
server.example.com. 86400 IN TXT "replicaSet=mySet&authSource=authDB"
190192

191-
In this case, taking into account both
192-
the DNS SRV records and the options retrieved from the TXT records, the parsed string will look like:
193+
In this case, taking into account both the DNS SRV records and the
194+
options retrieved from the TXT records, the parsed string will look like:
193195

194196
.. code-block:: none
195197

196198
mongodb://mongodb1.example.com:27317,mongodb2.example.com:27017/?replicaSet=mySet&authSource=authDB
197199

198-
Options set in a TXT record can be overridden by passing in a query string with the URI. In the example below,
199-
the query string has provided an override for the ``authSource`` option configured in the TXT record of the DNS
200-
entry above.
200+
Options set in a TXT record can be overridden by passing in a query
201+
string with the URI. In the example below, the query string has provided
202+
an override for the ``authSource`` option configured in the TXT record
203+
of the DNS entry above.
201204

202205
.. code-block:: none
203206

204207
mongodb+srv://server.example.com/?connectTimeoutMS=300000&authSource=aDifferentAuthDB
205208

206-
The rest of the option string will remain, and we can expect that the resulting URI
207-
would look like this (after parse).
209+
The rest of the option string will remain, and we can expect that the
210+
resulting URI would look like this (after parse).
208211

209212
.. code-block:: none
210213

211214
mongodb://mongodb1.example.com:27317,mongodb2.example.com:27017/?connectTimeoutMS=300000&replicaSet=mySet&authSource=aDifferentAuthDB
212215

213216
.. note::
214-
The ``mongodb+srv`` option will fail if there is no available DNS with records that correspond to the
215-
hostname identified in the connection string. In addition, use of the ``+srv`` connection string modifier
216-
sets the ``ssl`` option to ``true`` automatically for the connection. This can be overridden by explicitly setting
217-
the ``ssl`` option to ``false`` with ``ssl=false`` in the query string.
217+
The ``mongodb+srv`` option will fail if there is no available DNS
218+
with records that correspond to the hostname identified in the
219+
connection string. In addition, use of the ``+srv`` connection string
220+
modifier sets the ``ssl`` option to ``true`` automatically for the
221+
connection. This can be overridden by explicitly setting the ``ssl``
222+
option to ``false`` with ``ssl=false`` in the query string.
218223

219224

220225
.. index:: connections; options

0 commit comments

Comments
 (0)