Skip to content

Commit 54c9cca

Browse files
committed
docs
1 parent 58cdeb0 commit 54c9cca

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

docs/source/databases.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
``DATABASES`` settings
2+
======================
3+
4+
Some MongoDB-specific database settings are available via the Django
5+
``DATABASES`` setting.
6+
7+
SRV Connection
8+
--------------
9+
10+
For MongoDB Atlas clusters, you can use the ``srv`` connection string to
11+
connect to your cluster.
12+
13+
For example, you could configure ``HOST`` with a connection string like this::
14+
15+
DATABASES = {
16+
'default': {
17+
'ENGINE': 'django_mongodb',
18+
'NAME': 'mydatabase',
19+
'HOST': 'mongodb+srv://<cluster>',
20+
}
21+
}
22+
23+
Replica Sets
24+
------------
25+
26+
For MongoDB Replica Sets, you can configure the ``HOST`` setting with
27+
multiple host entries like this::
28+
29+
DATABASES = {
30+
'default': {
31+
'ENGINE': 'django_mongodb',
32+
'NAME': 'mydatabase',
33+
'HOST': 'localhost:27017,localhost:27018,localhost:27019',
34+
}
35+
}

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ django-mongodb 5.0.x documentation
55
:maxdepth: 1
66
:caption: Contents:
77

8+
databases
89
querysets
910

1011
Indices and tables

0 commit comments

Comments
 (0)