Skip to content

Commit 50d3412

Browse files
DOCSP-42303 Update username and password placeholders (#100)
(cherry picked from commit 952b1f9)
1 parent 1696440 commit 50d3412

18 files changed

+54
-54
lines changed

source/connect.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ zlib Compression Level
181181

182182
.. code-block:: python
183183

184-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
184+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
185185
compressors = "zlib",
186186
zlibCompressionLevel=<zlib compression level>)
187187

@@ -190,7 +190,7 @@ zlib Compression Level
190190

191191
.. code-block:: python
192192

193-
uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
193+
uri = ("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
194194
"compressors=zlib"
195195
"zlibCompressionLevel=<zlib compression level>")
196196
client = pymongo.MongoClient(uri)
@@ -203,7 +203,7 @@ Server Selection
203203

204204
.. code-block:: python
205205

206-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
206+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
207207
server_selector=<selector function>)
208208

209209
To learn more about customizing server selection, see
@@ -216,7 +216,7 @@ To learn more about customizing server selection, see
216216

217217
from pymongo.server_api import ServerApi
218218

219-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname:<port>",
219+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname:<port>",
220220
server_api=ServerApi("<{+stable-api+} version>"))
221221

222222
To learn more about the {+stable-api+}, see :ref:`pymongo-stable-api`.
@@ -244,15 +244,15 @@ timeoutMS Connection Option
244244

245245
.. code-block:: python
246246

247-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname@:<port>",
247+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname@:<port>",
248248
timeoutMS=<timeout length>)
249249

250250
.. tab:: Connection String
251251
:tabid: connectionstring
252252

253253
.. code-block:: python
254254

255-
uri = "mongodb://<username>:<password>@<hostname:<port>/?timeoutMS=<timeout length>"
255+
uri = "mongodb://<db_username>:<db_password>@<hostname:<port>/?timeoutMS=<timeout length>"
256256
client = pymongo.MongoClient(uri)
257257

258258
To learn more about client-side timeouts, see :ref:`pymongo-csot`.

source/connect/csot.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ The following code examples use the ``timeoutMS`` option to specify a timeout of
136136
.. code-block:: python
137137
:emphasize-lines: 2
138138

139-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname:<port>",
139+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname:<port>",
140140
timeoutMS=10000)
141141

142142
.. tab:: Connection String
@@ -145,7 +145,7 @@ The following code examples use the ``timeoutMS`` option to specify a timeout of
145145
.. code-block:: python
146146
:emphasize-lines: 1
147147

148-
uri = "mongodb://<username>:<password>@<hostname:<port>/?timeoutMS=10000"
148+
uri = "mongodb://<db_username>:<db_password>@<hostname:<port>/?timeoutMS=10000"
149149
client = pymongo.MongoClient(uri)
150150

151151
If you specify the ``timeoutMS`` option, {+driver-short+} automatically applies the
@@ -161,7 +161,7 @@ a timeout of 10 seconds, then call the ``insert_one()`` and
161161

162162
.. code-block:: python
163163

164-
uri = "mongodb://<username>:<password>@<hostname@:<port>/?timeoutMS=10000"
164+
uri = "mongodb://<db_username>:<db_password>@<hostname@:<port>/?timeoutMS=10000"
165165
client = pymongo.MongoClient(uri)
166166

167167
coll = client["test-db"]["test-collection"]

source/connect/network-compression.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ The following code example specifies the ``zlib`` compression algorithm and a va
7777
.. code-block:: python
7878
:emphasize-lines: 2-3
7979

80-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
80+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
8181
compressors = "zlib",
8282
zlibCompressionLevel=1)
8383

@@ -87,7 +87,7 @@ The following code example specifies the ``zlib`` compression algorithm and a va
8787
.. code-block:: python
8888
:emphasize-lines: 2-3
8989

90-
uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
90+
uri = ("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
9191
"compressors=zlib"
9292
"zlibCompressionLevel=1")
9393
client = pymongo.MongoClient(uri)

source/connect/server-selection.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ constructor and pass the ``server_selector`` argument with your function name as
121121

122122
.. code-block:: python
123123

124-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
124+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
125125
server_selector=prefer_local)
126126

127127
API Documentation

source/connect/stable-api.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The following code example shows how to specify {+stable-api+} version 1:
5656
from pymongo import MongoClient
5757
from pymongo.server_api import ServerApi
5858

59-
client = MongoClient("mongodb://<username>:<password>@<hostname:<port>",
59+
client = MongoClient("mongodb://<db_username>:<db_password>@<hostname:<port>",
6060
server_api=ServerApi("1"))
6161

6262
Once you create a ``MongoClient`` instance with
@@ -101,7 +101,7 @@ The following code example shows how you can use these parameters when construct
101101
from pymongo import MongoClient
102102
from pymongo.server_api import ServerApi
103103

104-
client = MongoClient("mongodb://<username>:<password>@<hostname:<port>",
104+
client = MongoClient("mongodb://<db_username>:<db_password>@<hostname:<port>",
105105
server_api=ServerApi("1",
106106
strict=True,
107107
deprecation_errors=True))

source/includes/connect/ca-file-tabs.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
.. code-block:: python
77
8-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
8+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
99
tls=True,
1010
tlsCAFile="/path/to/ca.pem")
1111
@@ -14,5 +14,5 @@
1414

1515
.. code-block:: python
1616
17-
uri = "mongodb://<username>:<password>@<hostname>:<port>/?tls=true&tlsCAFile=/path/to/ca.pem"
17+
uri = "mongodb://<db_username>:<db_password>@<hostname>:<port>/?tls=true&tlsCAFile=/path/to/ca.pem"
1818
client = pymongo.MongoClient(uri)

source/includes/connect/client-cert-tabs.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
.. code-block:: python
77
8-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
8+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
99
tls=True,
1010
tlsCertificateKeyFile='/path/to/client.pem')
1111
@@ -14,7 +14,7 @@
1414

1515
.. code-block:: python
1616
17-
uri = ("mongodb://<username>:<password>@<hostname:<port>/?"
17+
uri = ("mongodb://<db_username>:<db_password>@<hostname:<port>/?"
1818
"tls=true"
1919
"&tlsCertificateKeyFile=path/to/client.pem")
2020
client = pymongo.MongoClient(uri)

source/includes/connect/compression-tabs.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
.. code-block:: python
77
8-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
8+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
99
compressors = "snappy,zstd,zlib")
1010
1111
.. tab:: Connection String
1212
:tabid: connectionstring
1313

1414
.. code-block:: python
1515
16-
uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
16+
uri = ("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
1717
"compressors=snappy,zstd,zlib")
1818
client = pymongo.MongoClient(uri)

source/includes/connect/crl-tabs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
.. code-block:: python
77
8-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
8+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
99
tls=True,
1010
tlsCRLFile="/path/to/crl.pem")
1111

source/includes/connect/disable-cert-validation-tabs.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
.. code-block:: python
77
8-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
8+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
99
tls=True,
1010
tlsAllowInvalidCertificates=True)
1111
@@ -14,7 +14,7 @@
1414

1515
.. code-block:: python
1616
17-
uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
17+
uri = ("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
1818
"tls=true"
1919
"&tlsAllowInvalidCertificates=true")
2020
client = pymongo.MongoClient(uri)

source/includes/connect/disable-host-verification-tabs.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
.. code-block:: python
77
8-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
8+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
99
tls=True,
1010
tlsAllowInvalidHostnames=True)
1111
@@ -14,7 +14,7 @@
1414

1515
.. code-block:: python
1616
17-
uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
17+
uri = ("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
1818
"tls=true"
1919
"&tlsAllowInvalidHostnames=true")
2020
client = pymongo.MongoClient(uri)

source/includes/connect/insecure-tls-tabs.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
.. code-block:: python
77
8-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname:<port>",
8+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname:<port>",
99
tls=True,
1010
tlsInsecure=True)
1111
@@ -14,7 +14,7 @@
1414

1515
.. code-block:: python
1616
17-
uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
17+
uri = ("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
1818
"tls=true"
1919
"&tlsInsecure=true")
2020
client = pymongo.MongoClient(uri)

source/includes/connect/key-file-password.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
.. code-block:: python
77
8-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname:<port>",
8+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname:<port>",
99
tls=True,
1010
tlsCertificateKeyFile='/path/to/client.pem',
1111
tlsCertificateKeyFilePassword=<passphrase>)
@@ -15,7 +15,7 @@
1515

1616
.. code-block:: python
1717
18-
uri = ("mongodb://<username>:<password>@<hostname:<port>/?"
18+
uri = ("mongodb://<db_username>:<db_password>@<hostname:<port>/?"
1919
"tls=true"
2020
"&tlsCertificateKeyFile=path/to/client.pem"
2121
"&tlsCertificateKeyFilePassword=<passphrase>")

source/includes/connect/ocsp-tabs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
.. code-block:: python
77
8-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
8+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
99
tls=True,
1010
tlsDisableOCSPEndpointCheck=True)
1111

source/includes/connect/tls-tabs.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
.. code-block:: python
77
8-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname:<port>", tls=True)
8+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname:<port>", tls=True)
99
1010
.. tab:: Connection String
1111
:tabid: connectionstring
1212

1313
.. code-block:: python
1414
15-
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>?tls=true")
15+
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>?tls=true")

source/security.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ SCRAM-SHA-256
6363
.. code-block:: python
6464

6565
client = pymongo.MongoClient("mongodb://<hostname>:<port>",
66-
username="<username>",
67-
password="<password>",
66+
username="<db_username>",
67+
password="<db_password>",
6868
authSource="<authentication database>",
6969
authMechanism="SCRAM-SHA-256")
7070

@@ -93,8 +93,8 @@ SCRAM-SHA-1
9393
.. code-block:: python
9494

9595
client = pymongo.MongoClient("mongodb://<hostname>:<port>",
96-
username="<username>",
97-
password="<password>",
96+
username="<db_username>",
97+
password="<db_password>",
9898
authSource="<authentication database>",
9999
authMechanism="SCRAM-SHA-1")
100100

@@ -371,9 +371,9 @@ Windows
371371
.. code-block:: python
372372

373373
client = pymongo.MongoClient("mongodb://<hostname>:<port>",
374-
username="<username>",
374+
username="<db_username>",
375375
authMechanism="GSSAPI",
376-
password="<user password>",
376+
password="<db_password>",
377377
authMechanismProperties="SERVICE_NAME:<authentication service name>,
378378
CANONICALIZE_HOST_NAME:true,
379379
SERVICE_REALM:<service realm>")
@@ -410,8 +410,8 @@ PLAIN SASL
410410
.. code-block:: python
411411

412412
client = pymongo.MongoClient("mongodb://<hostname>:<port>",
413-
username="<username>",
414-
password="<password>",
413+
username="<db_username>",
414+
password="<db_password>",
415415
authMechanism="PLAIN",
416416
tls=True)
417417

@@ -420,7 +420,7 @@ PLAIN SASL
420420

421421
.. code-block:: python
422422

423-
uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
423+
uri = ("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
424424
"&authMechanism=PLAIN"
425425
"&tls=true")
426426
client = pymongo.MongoClient(uri)

0 commit comments

Comments
 (0)