diff --git a/source/connect.txt b/source/connect.txt index cb4e7f2..3ae7bfb 100644 --- a/source/connect.txt +++ b/source/connect.txt @@ -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. @@ -160,8 +162,12 @@ example: import django_mongodb_backend - MONGODB_URI = "mongodb+srv://my_user:my_password@cluster0.example.mongodb.net/?retryWrites=true&w=majority" - DATABASES["default"] = django_mongodb_backend.parse_uri(MONGODB_URI, db_name="") + MONGODB_URI = "mongodb+srv://my_user:my_password@cluster0.example.mongodb.net/" + DATABASES["default"] = django_mongodb_backend.parse_uri( + MONGODB_URI, + db_name="", + options={"retryWrites": True, "w": "majority"} + ) Additional Information ----------------------