Docs Menu
Docs Home
/ / /
Django MongoDB Backend

Limitations and Upcoming Features

On this page

  • Overview
  • Feature Limitations
  • Transaction management
  • Model Limitations
  • Querying Limitations
  • Unsupported Management Commands
  • Migration Limitations
  • Performance
  • General Availability Release Features
  • MongoDB Features
  • Model Features
  • Management Command Features
  • Third-Party Libraries

On this page, you can find a list of features that Django MongoDB Backend does not support. You can also find features currently planned for the General Availability (GA) and post-GA releases. We will prioritize these upcoming features based on user demand, and you can request support for a feature by creating a JIRA issue.

In this section, you can learn about the following types of unsupported Django and MongoDB features:

  • Transaction management

  • Model Limitations

  • Querying Limitations

  • Unsupported Management Commands

  • Migration Limitations

  • Performance

Query execution uses Django and MongoDB's default behavior of autocommit mode. Each query is immediately committed to the database.

Django's transaction management APIs are not supported.

Django doesn't support MongoDB's polymorphic pattern where slightly different models share the same collection.

Django MongoDB Backend does not support the following index functionalities:

  • Creating $vectorSearch and $search indexes through the Django Indexes API

  • Creating geospatial indexes through the Django Indexes API

  • Updating indexes in EmbeddedModelFields after model creation

Django MongoDB Backend has the following limitations on the specified field types:

  • ArrayField

    • ArrayField polymorphism is not supported.

    • Nested EmbeddedModelField values within an ArrayField are not supported.

  • EmbeddedModelField

    • EmbeddedModel schema changes do not register after creation.

    • Embedded documents cannot take Django foreign keys.

    • Arbitrary or untyped embedded model fields are not supported. You must derive all fields from a EmbeddedModel class.

  • JSONField

    • Django MongoDB Backend cannot distinguish between a JSON and a SQL null value. Queries that use Value(None, JSONField()) or the isnull lookup return both JSON and SQL null values.

    • Some queries with Q objects, such as Q(value__foo="bar"), might not work as expected.

    • Filtering for None values incorrectly returns objects in which a field does not exist.

  • DateTimeField

    • Microsecond granularity for DateTimeField values is not supported.

  • DurationField

    • DurationField stores milliseconds rather than microseconds.

  • ForeignKey

The following field types are unavailable in Django MongoDB Backend:

  • GeneratedField

  • AutoField (including BigAutoField and SmallAutoField)

Django MongoDB Backend does not support the following QuerySet API methods:

  • distinct()

  • dates()

  • datetimes()

  • prefetch_related()

  • extra()

Django MongoDB Backend does not support QuerySet.delete() and update() queries that span multiple collections.

Django MongoDB Backend does not support the following geospatial query features:

  • GeoDjango

  • Django lookup operators for MongoDB-specific geospatial queries

Django MongoDB Backend does not include any custom Django field lookups for the MongoDB aggregation framework. Instead, use the raw_aggregate() method. See the Perform Raw Database Queries guide.

Django MongoDB Backend does not support the following database functions:

  • Chr

  • ExtractQuarter

  • MD5

  • Now

  • Ord

  • Pad

  • Repeat

  • Reverse

  • Right

  • SHA1, SHA224, SHA256, SHA384, SHA512

  • Sign

The tzinfo parameter of the Trunc database functions doesn't work properly because MongoDB converts the result back to UTC.

The following django-admin commands are unsupported:

  • createcachetable

  • inspectdb

Django MongoDB Backend does not support the following migration features:

The engineering team is prioritizing feature development for the Public Preview release of Django MongoDB Backend. Because of this, you might notice performance limitations with certain workloads. If you encounter any performance issues, please report them as shown in the Issues & Help guide.

In this section, you can learn about the following types of Django and MongoDB features that GA and post-GA Django MongoDB Backend releases will likely introduce:

We plan to support the following MongoDB features in the GA release:

  • Programmatic management of Vector Search, Atlas Search, and geospatial indexes by using the Django API

  • Vector Search, Atlas Search, and geospatial queries by using the Django API

  • Queryable Encryption and Client-side Field Level Encryption

  • Database transactions

  • Storage of cached data in the database

We plan to support the following MongoDB features in future post-GA releases:

  • GridFS for large file storage

  • Change streams for data monitoring

  • Schema validation

Tip

To learn more about the MongoDB features mentioned in this section, see the following resources:

We plan to support the following model features in the GA release:

  • Arrays of embedded documents

  • Polymorphic embedded documents and arrays

  • Application of changes to the embedded model schema to EmbeddedModelField values

  • Multiple models within a collection

  • Improved form representation in embedded models

In a future post-GA release, we plan to add a custom model field for the BSONRegExp data type.

Serialization support for EmbeddedModelField (i.e. Django's dumpdata and loaddata management commands) will be added by the GA release.

We plan to test compatibility with the following third-party libraries by the GA release:

Back

Perform Raw Queries