Overview
On this page, you can find information about supported and unsupported features in Django MongoDB Backend. You can also find features currently planned for future releases. We will prioritize these upcoming features based on user demand, and you can request support for a feature by creating a JIRA issue.
Performance Limitations
Django MongoDB Backend supports the following operations, but they might be less performant:
Operation | Performance Notes |
---|---|
| Queries that use the $expr operator might run slowly, since
this operator often cannot predict which index to use and performs
a collection scan. Some QuerySet operations, such as queries that
specify an in lookup, use $expr to evaluate the query results and
experience degraded performance.We plan to address this performance issue in a
post-GA release. |
| Queries that use the $lookup operator might run slowly.
To improve performance, we recommend that you use embedded
models instead of the $lookup operator when possible.
To learn more about how to reduce $lookup operations, see the Reduce $lookup Operations guide in the MongoDB Atlas
documentation. |
MongoDB Features
This section indicates whether Django MongoDB Backend supports various MongoDB features.
Index Support
MongoDB Feature | Current Support |
---|---|
Atlas Search indexes | Partially Supported. You can use Django MongoDB Backend to create basic Atlas Search indexes that specify an index name and the fields to index. All other index definition fields are unsupported. MongoDB does not support Atlas Search indexes on some data types. To view a list of unsupported types, see Data Type Limitations in the MongoDB Atlas documentation. |
Atlas Vector Search indexes | Partially Supported. You can use Django MongoDB Backend to create basic Atlas Vector Search indexes that specify an index name, the fields to index, and a similarity function. All other index definition fields are unsupported. |
Compound indexes | ✓ |
Embedded document indexes | ✓ |
Geospatial indexes | ✓ |
Multikey indexes | ✓ |
Partial indexes | ✓ |
Single field indexes | ✓ |
Unique indexes | ✓ |
Updating embedded model indexes after model creation | Unsupported. |
| ✓ |
| Unsupported. |
Data Type Support
Django MongoDB Backend currently supports all MongoDB data types not included in the following table. To view a full list of supported types, see the MongoDB BSON Fields section of the Create Models guide.
BSON Data Type | Current Support |
---|---|
| ✓ You can use embedded models and polymorphic embedded models to represent objects.
If you are using the EmbeddedModelField field, the following
limitations apply:
- Foreign key fields are not supported.
- Arbitrary or untyped embedded model fields are not supported. You must
derive all fields from an EmbeddedModel class. |
| Unsupported. However, we plan to support this type in a post-GA release. |
Query Support
MongoDB Feature | Current Support |
---|---|
Aggregation operations | Partially Supported. The Django MongoDB Backend does not include custom Django field lookups for the MongoDB aggregation framework, but you can use the raw_aggregate() method. |
Atlas Search queries | ✓ |
Delete operations | ✓ |
Geospatial queries | ✓ Use the raw_aggregate() method
to run geospatial queries instead of the GIS QuerySet API. |
Insert operations | ✓ |
Read operations | ✓ |
Update operations | ✓ |
Vector Search queries | ✓ |
Database and Collection Support
MongoDB Feature | Current Support |
---|---|
Asynchronous support | ✓ |
Authentication | ✓ |
Cached data storage | Unsupported. However, we plan to add support for this feature in a post-GA release. |
Change Streams | Unsupported. However, we plan to add support for this feature in a post-GA release. |
Client-side Field Level Encryption and Queryable Encryption | Unsupported. However, we plan to add support for this feature in a post-GA release. |
Collection interaction | ✓ |
Database interaction | ✓ |
GridFS | Unsupported. However, we plan to add support for this feature in a post-GA release. |
Multiple models for one collection | Unsupported. |
Representing documents | ✓ Use models to represent MongoDB documents. |
Schema validation | Unsupported. However, we plan to add support for this feature in a post-GA release. |
Timeseries data | ✓ |
Transactions | ✓ You can use Django MongoDB Backend's custom transactions API with the
following limitations:
- QuerySet.union() is not supported within a transaction.
- Savepoints, or nested atomic blocks, are not supported. The outermost atomic block starts
a transaction, and any subsequent atomic blocks have no effect.
- Your MongoDB deployment must be a replica set or sharded cluster. |
Django Features
This section indicates whether the Django MongoDB Backend supports various Django features.
Field Support
Django MongoDB Backend currently supports all Django fields not included in the following table. To view a full list of supported fields, see the Django Fields section of the Create Models guide.
Django Field Type | Current Support |
---|---|
| Unsupported. The |
| Unsupported. |
| ✓ Microsecond granularity for DateTimeField values is not supported. |
| ✓ DurationField stores milliseconds rather than microseconds. |
| Partially Supported. You can use this field type with the following limitations:
|
| Unsupported. |
| Partially Supported. You can use this field type with the following limitations:
|
Query Support
Django MongoDB Backend currently supports all Django QuerySet
methods not
included in the following table. To view the supported methods, see QuerySet API in the Django
documentation.
Django QuerySet Feature | Current Support |
---|---|
| ✓ You cannot use this method to perform
queries that span multiple collections. |
| Unsupported. |
Pattern-matching lookups | ✓ You can only use these lookups to query string fields. The pattern-matching lookups are iexact , startswith , istartswith ,
endswith , iendswith , contains , icontains , regex , and
iregex |
| Unsupported. |
| Unsupported. However, you can use the |
| ✓ You cannot use this method to perform
queries that span multiple collections. |
Database Function Support
Django MongoDB Backend currently supports all database functions not included in the following table. To view a full list of functions, see Database Functions in the Django documentation.
Django Function | Current Support |
---|---|
| Unsupported. |
| Unsupported. |
| Unsupported. |
| Unsupported. |
| Unsupported. |
| Unsupported. |
| Unsupported. |
| Unsupported. |
| Unsupported. |
| Unsupported. |
| Unsupported. |
|
Contrib App Support
Django Feature | Current Support |
---|---|
Django Admin | ✓ |
Django Authentication | ✓ |
GeoDjango | Partially Supported. This web framework is supported with the following limitations:
|
Forms Support
Django MongoDB Backend supports Django forms, but PolymorphicEmbeddedModelField
and PolymorphicEmbeddedModelArrayField
do not appear in forms.
Management Command Support
Django MongoDB Backend currently supports all management commands not included in the following table. To view a full list of commands, see Available commands in the Django documentation.
Django Command | Current Support |
---|---|
| Unsupported. |
| Unsupported. However, we plan to add support for this feature in a post-GA release. |
| Unsupported. However, we plan to add support for this feature in a post-GA release. |
| Unsupported. However, we plan to add support for this feature in a post-GA release. |
Migration Support
Django Feature | Current Support |
---|---|
Creating, deleting, and updating indexes through migration commands | Partially Supported. You cannot update indexes on embedded model or array fields. |
Unsupported. | |
| Unsupported. |
Migrations for embedded models | Partially Supported. Migration commands do not detect changes to embedded model fields
or embedded models referenced by a |
Third Party Library Support
Library | Current Support |
---|---|
Partially Supported. To learn more about the use cases and limitations of this library, see Django filter in the Django MongoDB CLI documentation. | |
Partially Supported. To learn more about the use cases and limitations of this library, see Django rest framework in the Django MongoDB CLI documentation. | |
Partially Supported. To learn more about the use cases and limitations of this library, see Django allauth in the Django MongoDB CLI documentation. | |
Partially Supported. To learn more about the use cases and limitations of this library, see Django debug toolbar in the Django MongoDB CLI documentation. |