@@ -10,15 +10,15 @@ Connection URI
10
10
--------------
11
11
12
12
The **connection URI** is the set of instructions that the driver uses to
13
- connect to a MongoDB instance or replica set deployment. It instructs the
14
- driver on how it should connect to MongoDB and how it should behave while
15
- connected. The following example shows each part of the connection URI:
13
+ connect to a MongoDB deployment. It instructs the driver on how it should
14
+ connect to MongoDB and how it should behave while connected. The following
15
+ example shows each part of the connection URI:
16
16
17
17
.. figure:: /includes/figures/connection_string_parts.png
18
18
19
19
20
- In this example, for the connection string format , we use ``mongodb+srv`` which
21
- specifies the :manual:`DNS Seedlist Connection Format
20
+ In this example, for the protocol , we use ``mongodb+srv`` which specifies the
21
+ :manual:`DNS Seedlist Connection Format
22
22
</reference/connection-string/#dns-seedlist-connection-format>`. This indicates
23
23
that the hostname following it corresponds to the DNS SRV record of your
24
24
MongoDB instance or deployment. If your instance or deployment does not have a
@@ -44,7 +44,8 @@ your MongoDB instance.
44
44
45
45
The last part of the connection string contains connection and authentication
46
46
options as parameters. In the example above, we set two connection options:
47
- ``poolSize=20`` and ``w=majority``.
47
+ ``poolSize=20`` and ``w=majority``.
48
+ For more information on connection options, skip to the :ref:`Connection Options` section.
48
49
49
50
The code below shows how you can use the sample connection URI in a client to
50
51
connect to MongoDB.
@@ -61,13 +62,13 @@ A MongoDB replica set deployment is a group of connected instances that
61
62
store the same set of data. This configuration of instances provides data
62
63
redundancy and high data availability.
63
64
64
- To connect to a replica set deployment, specify the host and port numbers of
65
- each instance, separated by a comma, and the replica set name as the value of
66
- the ``replicaSet`` parameter.
65
+ To connect to a replica set deployment, specify the hostname and port numbers
66
+ of each instance, separated by a comma, and the replica set name as the value
67
+ of the ``replicaSet`` parameter in the connection string.
67
68
68
- .. code-block::
69
+ .. code-block:: none
69
70
70
- mongodb+srv ://host1:27017,host2:27017,host3:27017/?replicaSet=myRs
71
+ mongodb://host1:27017,host2:27017,host3:27017/?replicaSet=myRs
71
72
72
73
.. note::
73
74
0 commit comments