@@ -87,7 +87,8 @@ perform automatic discovery to find the others. To instruct the driver to perfor
87
87
automatic discovery, perform one of the following actions:
88
88
89
89
- Specify the name of the replica set as the value of the ``replicaSet`` parameter.
90
- - Specify ``false`` as the value of the ``directConnection`` parameter.
90
+ - Specify ``false`` as the value of the ``directConnection`` parameter. You can also omit
91
+ this parameter, as it defaults to ``false``.
91
92
- Specify more than one host in the replica set.
92
93
93
94
In the following example, the driver uses a sample connection URI to connect to the
@@ -114,13 +115,12 @@ balances operations across multiple MongoDB deployments, see the
114
115
of its ``nodes`` attribute, the list might be empty while the client connects to
115
116
the replica set members.
116
117
117
- Initialization
118
- ~~~~~~~~~~~~~~
118
+ Connect to a Single Server
119
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
119
120
120
- To initialize a replica set, you must connect directly to a single member. To do so,
121
- set the ``directConnection`` connection
122
- option to ``true``. You can do this in two ways: by passing an argument to the
123
- ``MongoClient`` constructor or through a parameter in your connection string. Select the
121
+ To connect to a single server in a replica set rather than the entire replica set, specify
122
+ ``false`` as the value of the ``directConnection`` connection option. You can do this in two ways: by passing
123
+ an argument to the ``MongoClient`` constructor or through a parameter in your connection string. Select the
124
124
:guilabel:`MongoClientSettings` or :guilabel:`Connection String` tab to see the corresponding code.
125
125
126
126
.. tabs::
0 commit comments