File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -144,8 +144,10 @@ function accepts the following arguments:
144
144
145
145
- ``uri``: Your MongoDB connection URI.
146
146
- ``db_name``: The name of the database you want to use.
147
- - ``test``: Provides a dictionary of settings for test
148
- databases. This argument is optional. To learn more, see
147
+ - ``options``: *(Optional)* A dictionary of options to apply to the connection.
148
+ These options take precedence over any duplicate options specified in the URI.
149
+ - ``test``: *(Optional)* Provides a dictionary of settings for test
150
+ databases. To learn more, see
149
151
`the TEST setting <{+django-docs+}/ref/settings/#test>`__
150
152
in the {+framework+} documentation.
151
153
@@ -160,8 +162,12 @@ example:
160
162
161
163
import django_mongodb_backend
162
164
163
- MONGODB_URI = "mongodb+srv://my_user:
[email protected] /?retryWrites=true&w=majority"
164
- DATABASES["default"] = django_mongodb_backend.parse_uri(MONGODB_URI, db_name="<database name>")
165
+ MONGODB_URI = "mongodb+srv://my_user:
[email protected] /"
166
+ DATABASES["default"] = django_mongodb_backend.parse_uri(
167
+ MONGODB_URI,
168
+ db_name="<database name>",
169
+ options={"retryWrites": "true", "w": "majority"}
170
+ )
165
171
166
172
Additional Information
167
173
----------------------
You can’t perform that action at this time.
0 commit comments