@@ -181,7 +181,7 @@ zlib Compression Level
181
181
182
182
.. code-block:: python
183
183
184
- client = pymongo.MongoClient("mongodb://<username >:<password >@<hostname>:<port>",
184
+ client = pymongo.MongoClient("mongodb://<db_username >:<db_password >@<hostname>:<port>",
185
185
compressors = "zlib",
186
186
zlibCompressionLevel=<zlib compression level>)
187
187
@@ -190,7 +190,7 @@ zlib Compression Level
190
190
191
191
.. code-block:: python
192
192
193
- uri = ("mongodb://<username >:<password >@<hostname>:<port>/?"
193
+ uri = ("mongodb://<db_username >:<db_password >@<hostname>:<port>/?"
194
194
"compressors=zlib"
195
195
"zlibCompressionLevel=<zlib compression level>")
196
196
client = pymongo.MongoClient(uri)
@@ -203,7 +203,7 @@ Server Selection
203
203
204
204
.. code-block:: python
205
205
206
- client = pymongo.MongoClient("mongodb://<username >:<password >@<hostname>:<port>",
206
+ client = pymongo.MongoClient("mongodb://<db_username >:<db_password >@<hostname>:<port>",
207
207
server_selector=<selector function>)
208
208
209
209
To learn more about customizing server selection, see
@@ -216,7 +216,7 @@ To learn more about customizing server selection, see
216
216
217
217
from pymongo.server_api import ServerApi
218
218
219
- client = pymongo.MongoClient("mongodb://<username >:<password >@<hostname:<port>",
219
+ client = pymongo.MongoClient("mongodb://<db_username >:<db_password >@<hostname:<port>",
220
220
server_api=ServerApi("<{+stable-api+} version>"))
221
221
222
222
To learn more about the {+stable-api+}, see :ref:`pymongo-stable-api`.
@@ -244,15 +244,15 @@ timeoutMS Connection Option
244
244
245
245
.. code-block:: python
246
246
247
- client = pymongo.MongoClient("mongodb://<username >:<password >@<hostname@:<port>",
247
+ client = pymongo.MongoClient("mongodb://<db_username >:<db_password >@<hostname@:<port>",
248
248
timeoutMS=<timeout length>)
249
249
250
250
.. tab:: Connection String
251
251
:tabid: connectionstring
252
252
253
253
.. code-block:: python
254
254
255
- uri = "mongodb://<username >:<password >@<hostname:<port>/?timeoutMS=<timeout length>"
255
+ uri = "mongodb://<db_username >:<db_password >@<hostname:<port>/?timeoutMS=<timeout length>"
256
256
client = pymongo.MongoClient(uri)
257
257
258
258
To learn more about client-side timeouts, see :ref:`pymongo-csot`.
0 commit comments