Skip to content

DOCSP-42303 Update username and password placeholders #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions source/connect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ zlib Compression Level

.. code-block:: python

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

Expand All @@ -190,7 +190,7 @@ zlib Compression Level

.. code-block:: python

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

.. code-block:: python

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

To learn more about customizing server selection, see
Expand All @@ -216,7 +216,7 @@ To learn more about customizing server selection, see

from pymongo.server_api import ServerApi

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

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

.. code-block:: python

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

.. tab:: Connection String
:tabid: connectionstring

.. code-block:: python

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

To learn more about client-side timeouts, see :ref:`pymongo-csot`.
Expand Down
6 changes: 3 additions & 3 deletions source/connect/csot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ The following code examples use the ``timeoutMS`` option to specify a timeout of
.. code-block:: python
:emphasize-lines: 2

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

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

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

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

.. code-block:: python

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

coll = client["test-db"]["test-collection"]
Expand Down
4 changes: 2 additions & 2 deletions source/connect/network-compression.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ The following code example specifies the ``zlib`` compression algorithm and a va
.. code-block:: python
:emphasize-lines: 2-3

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

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

uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
uri = ("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
"compressors=zlib"
"zlibCompressionLevel=1")
client = pymongo.MongoClient(uri)
2 changes: 1 addition & 1 deletion source/connect/server-selection.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ constructor and pass the ``server_selector`` argument with your function name as

.. code-block:: python

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

API Documentation
Expand Down
4 changes: 2 additions & 2 deletions source/connect/stable-api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The following code example shows how to specify {+stable-api+} version 1:
from pymongo import MongoClient
from pymongo.server_api import ServerApi

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

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

client = MongoClient("mongodb://<username>:<password>@<hostname:<port>",
client = MongoClient("mongodb://<db_username>:<db_password>@<hostname:<port>",
server_api=ServerApi("1",
strict=True,
deprecation_errors=True))
Expand Down
4 changes: 2 additions & 2 deletions source/includes/connect/ca-file-tabs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.. code-block:: python

client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
tls=True,
tlsCAFile="/path/to/ca.pem")

Expand All @@ -14,5 +14,5 @@

.. code-block:: python

uri = "mongodb://<username>:<password>@<hostname>:<port>/?tls=true&tlsCAFile=/path/to/ca.pem"
uri = "mongodb://<db_username>:<db_password>@<hostname>:<port>/?tls=true&tlsCAFile=/path/to/ca.pem"
client = pymongo.MongoClient(uri)
4 changes: 2 additions & 2 deletions source/includes/connect/client-cert-tabs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.. code-block:: python

client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
tls=True,
tlsCertificateKeyFile='/path/to/client.pem')

Expand All @@ -14,7 +14,7 @@

.. code-block:: python

uri = ("mongodb://<username>:<password>@<hostname:<port>/?"
uri = ("mongodb://<db_username>:<db_password>@<hostname:<port>/?"
"tls=true"
"&tlsCertificateKeyFile=path/to/client.pem")
client = pymongo.MongoClient(uri)
4 changes: 2 additions & 2 deletions source/includes/connect/compression-tabs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

.. code-block:: python

client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
compressors = "snappy,zstd,zlib")

.. tab:: Connection String
:tabid: connectionstring

.. code-block:: python

uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
uri = ("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
"compressors=snappy,zstd,zlib")
client = pymongo.MongoClient(uri)
2 changes: 1 addition & 1 deletion source/includes/connect/crl-tabs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.. code-block:: python

client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
tls=True,
tlsCRLFile="/path/to/crl.pem")

Expand Down
4 changes: 2 additions & 2 deletions source/includes/connect/disable-cert-validation-tabs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.. code-block:: python

client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
tls=True,
tlsAllowInvalidCertificates=True)

Expand All @@ -14,7 +14,7 @@

.. code-block:: python

uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
uri = ("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
"tls=true"
"&tlsAllowInvalidCertificates=true")
client = pymongo.MongoClient(uri)
4 changes: 2 additions & 2 deletions source/includes/connect/disable-host-verification-tabs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.. code-block:: python

client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
tls=True,
tlsAllowInvalidHostnames=True)

Expand All @@ -14,7 +14,7 @@

.. code-block:: python

uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
uri = ("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
"tls=true"
"&tlsAllowInvalidHostnames=true")
client = pymongo.MongoClient(uri)
4 changes: 2 additions & 2 deletions source/includes/connect/insecure-tls-tabs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.. code-block:: python
client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname:<port>",
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname:<port>",
tls=True,
tlsInsecure=True)
Expand All @@ -14,7 +14,7 @@

.. code-block:: python
uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
uri = ("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
"tls=true"
"&tlsInsecure=true")
client = pymongo.MongoClient(uri)
4 changes: 2 additions & 2 deletions source/includes/connect/key-file-password.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.. code-block:: python

client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname:<port>",
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname:<port>",
tls=True,
tlsCertificateKeyFile='/path/to/client.pem',
tlsCertificateKeyFilePassword=<passphrase>)
Expand All @@ -15,7 +15,7 @@

.. code-block:: python

uri = ("mongodb://<username>:<password>@<hostname:<port>/?"
uri = ("mongodb://<db_username>:<db_password>@<hostname:<port>/?"
"tls=true"
"&tlsCertificateKeyFile=path/to/client.pem"
"&tlsCertificateKeyFilePassword=<passphrase>")
Expand Down
2 changes: 1 addition & 1 deletion source/includes/connect/ocsp-tabs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.. code-block:: python

client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>",
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>",
tls=True,
tlsDisableOCSPEndpointCheck=True)

Expand Down
4 changes: 2 additions & 2 deletions source/includes/connect/tls-tabs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

.. code-block:: python

client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname:<port>", tls=True)
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname:<port>", tls=True)

.. tab:: Connection String
:tabid: connectionstring

.. code-block:: python

client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname>:<port>?tls=true")
client = pymongo.MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>?tls=true")
18 changes: 9 additions & 9 deletions source/security.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ SCRAM-SHA-256
.. code-block:: python

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

Expand Down Expand Up @@ -93,8 +93,8 @@ SCRAM-SHA-1
.. code-block:: python

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

Expand Down Expand Up @@ -371,9 +371,9 @@ Windows
.. code-block:: python

client = pymongo.MongoClient("mongodb://<hostname>:<port>",
username="<username>",
username="<db_username>",
authMechanism="GSSAPI",
password="<user password>",
password="<db_password>",
authMechanismProperties="SERVICE_NAME:<authentication service name>,
CANONICALIZE_HOST_NAME:true,
SERVICE_REALM:<service realm>")
Expand Down Expand Up @@ -410,8 +410,8 @@ PLAIN SASL
.. code-block:: python

client = pymongo.MongoClient("mongodb://<hostname>:<port>",
username="<username>",
password="<password>",
username="<db_username>",
password="<db_password>",
authMechanism="PLAIN",
tls=True)

Expand All @@ -420,7 +420,7 @@ PLAIN SASL

.. code-block:: python

uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
uri = ("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
"&authMechanism=PLAIN"
"&tls=true")
client = pymongo.MongoClient(uri)
Expand Down
Loading
Loading