Skip to content

Commit 2c92609

Browse files
add limitations
1 parent f8c7bd5 commit 2c92609

File tree

2 files changed

+198
-0
lines changed

2 files changed

+198
-0
lines changed

source/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Django MongoDB Backend
1111

1212
.. toctree::
1313

14+
Limitations </limitations>
1415
Issues & Help </issues-and-help>
1516
Compatibility </compatibility>
1617

source/limitations.txt

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
.. _django-limitations:
2+
3+
============
4+
Limitations
5+
============
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
.. facet::
14+
:name: genre
15+
:values: reference
16+
17+
.. meta::
18+
:keywords: support, features, django
19+
20+
Overview
21+
--------
22+
23+
On this page, you can find a list of features that
24+
{+django-odm+} does not support. Because {+django-odm+} is in active
25+
development, some features listed on this page might be considered for future
26+
releases based on customer demand.
27+
28+
Unsupported Database Variables
29+
------------------------------
30+
31+
The following database variables are not supported by {+django-odm+}:
32+
33+
- ``ATOMIC_REQUESTS``
34+
- ``AUTOCOMMIT``
35+
- ``CONN_HEALTH_CHECKS``
36+
- ``TIME_ZONE``
37+
38+
Model Limitations
39+
-----------------
40+
41+
The following model limitations apply to {+django-odm+}:
42+
43+
- {+django-odm+} does not support multiple models within a collection.
44+
45+
Indexes
46+
~~~~~~~
47+
48+
{+django-odm+} does not support the following index functionalities:
49+
50+
- Creation of ``$vectorSearch`` and ``$search`` indexes through the Django
51+
Indexes API
52+
- Creating geospatial indexes through the Django Indexes API
53+
- Updating indexes in ``EmbeddedModelFields`` after model creation
54+
55+
Fields
56+
~~~~~~
57+
58+
{+django-odm+} has the following limitations on the specified field types:
59+
60+
- ``ArrayField``
61+
62+
- {+django-odm+} does not support ``ArrayField`` polymorphism.
63+
- {+django-odm+} does not support ``EmbeddedModelField`` within an ``ArrayField``.
64+
65+
- ``EmbeddedModelField``
66+
67+
- You cannot change embedded models after creation.
68+
- Embedded documents cannot take Django foreign keys.
69+
- {+django-odm+} does not support arbitrary or untyped embedded model
70+
fields. You must derive all fields from a ``Model`` class.
71+
72+
- ``JSONField``
73+
74+
- {+django-odm+} cannot distinguish between a JSON and a SQL ``null`` value.
75+
Queries that use ``Value(None, JSONField())`` or the ``isnull`` lookup
76+
return both JSON and SQL ``null`` values.
77+
- Some queries with ``Q`` objects, such as ``Q(value__foo="bar")``, might
78+
not work as expected.
79+
- Filtering with a ``None`` key incorrectly returns objects in which a key
80+
does not exist.
81+
82+
- ``DateTimeField``
83+
84+
- {+django-odm+} does not support microsecond granularity for
85+
``DateTimeField``.
86+
87+
- ``DurationField``
88+
89+
- The ``DurationField`` stores milliseconds rather than microseconds.
90+
91+
The following field types are unavailable in {+django-odm+}:
92+
93+
- ``GeneratedField``
94+
- ``ImageField``
95+
96+
- ``ForeignKey``
97+
98+
- When possible, you should use an ``EmbeddedModelField`` instead of a
99+
``ForeignKey`` field to avoid using ``$lookup`` operations. An
100+
``EmbeddedModelField`` emulates a MongoDB embedded document, and performs
101+
better than a ``ForeignKey`` field. To learn more about how to reduce
102+
``$lookup`` operations, see the :atlas:`Reduce $lookup Operations
103+
</schema-suggestions/reduce-lookup-operations/>` guide in the Atlas
104+
documentation.
105+
- The performance of `CASCADE deletes <{+django-docs+}/ref/models/fields/#foreignkey>`__
106+
on a ``ForeignKey`` field is not as performant as using an
107+
``EmbeddedModelField``.
108+
109+
Querying Limitations
110+
--------------------
111+
112+
{+django-odm+} does not support the following ``QuerySet`` API methods:
113+
114+
- ``distinct()``
115+
- ``dates()``
116+
- ``datetimes()``
117+
- ``prefetch_related()``
118+
- ``extra()``
119+
120+
{+django-odm+} does not support ``QuerySet.delete()`` and ``update()`` queries
121+
that span multiple collections.
122+
123+
Geospatial Queries
124+
~~~~~~~~~~~~~~~~~~
125+
126+
- {+django-odm+} does not support ``GeoDjango``.
127+
- {+django-odm+} does not have any ``$lookup`` operators for MongoDB-specific
128+
geospatial queries.
129+
130+
Aggregation operators
131+
~~~~~~~~~~~~~~~~~~~~~
132+
133+
{+django-odm+} does not contain any custom Django Field lookups for the MongoDB
134+
aggregation framework. Instead, use the ``raw_aggregate`` method. For more
135+
information on the ``raw_aggregate`` method.
136+
137+
.. TODO: Link to aggregation
138+
139+
Database Functions
140+
~~~~~~~~~~~~~~~~~~
141+
142+
{+django-odm+} does not support the following database functions:
143+
144+
- ``Chr``
145+
- ``ExtractQuarter``
146+
- ``MD5``
147+
- ``Now``
148+
- ``Ord``
149+
- ``Pad``
150+
- ``Repeat``
151+
- ``Reverse``
152+
- ``Right``
153+
- ``SHA1``, ``SHA224``, ``SHA256``, ``SHA384``, ``SHA512``
154+
- ``Sign``
155+
156+
The ``tzinfo`` parameter of the ``Trunc`` database functions doesn't work
157+
properly because MongoDB converts the result back to UTC.
158+
159+
Django Management Command Limitations
160+
-------------------------------------
161+
162+
{+django-odm+} does not support the following Django management commands:
163+
164+
- ``createcachetable``
165+
- ``inspectdb``
166+
- ``optimizemigration``
167+
- ``sqlflush``
168+
- ``sqlsequencereset``
169+
170+
Migration Limitations
171+
---------------------
172+
173+
- {+django-odm+} does not support enforced schema validation. To learn how to
174+
enforce schema validation in your application, see the :manual:`Specify JSON
175+
Schema Validation </core/schema-validation/specify-json-schema/>` guide in the
176+
{+mdb-server+} manual.
177+
- {+django-odm+} does not support `DDL Transactions
178+
<{+django-docs+}/topics/migrations/#transactions>`__.
179+
- {+django-odm+} does not support the ``migrate --fake-initial`` command.
180+
181+
Asynchronous Support
182+
--------------------
183+
184+
{+django-odm+} has not been tested for support of the asynchronous functionality of
185+
the Django API.
186+
187+
Data Types
188+
----------
189+
190+
{+django-odm+} does not have a custom ``Field`` class for the ``BSONRegExp``
191+
data type. Instead, use the ``CharField`` class.
192+
193+
Performance
194+
-----------
195+
196+
The engineering team is prioritizing performance improvements prior to the
197+
General Availability release of {+django-odm+}.

0 commit comments

Comments
 (0)