Skip to content
Merged
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
14 changes: 10 additions & 4 deletions source/connect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ function accepts the following arguments:

- ``uri``: Your MongoDB connection URI.
- ``db_name``: The name of the database you want to use.
- ``test``: Provides a dictionary of settings for test
databases. This argument is optional. To learn more, see
- ``options``: *(Optional)* A dictionary of options to apply to the connection.
These options take precedence over any duplicate options that you specify in the URI.
- ``test``: *(Optional)* Provides a dictionary of settings for test
databases. To learn more, see
`the TEST setting <{+django-docs+}/ref/settings/#test>`__
in the {+framework+} documentation.

Expand All @@ -160,8 +162,12 @@ example:

import django_mongodb_backend

MONGODB_URI = "mongodb+srv://my_user:[email protected]/?retryWrites=true&w=majority"
DATABASES["default"] = django_mongodb_backend.parse_uri(MONGODB_URI, db_name="<database name>")
MONGODB_URI = "mongodb+srv://my_user:[email protected]/"
DATABASES["default"] = django_mongodb_backend.parse_uri(
MONGODB_URI,
db_name="<database name>",
options={"retryWrites": True, "w": "majority"}
)

Additional Information
----------------------
Expand Down
Loading