Docs Menu
Docs Home
/ /

Release Notes

Learn what's new in:

  • Version 6.0

  • Version 5.2

  • Version 5.1

This section lists the changes introduced in the following patch releases:

The Django MongoDB Backend v6.0.3 release includes the following features, improvements, and fixes:

  • Adds support for ObjectId matching in URL patterns. To learn more, see URL dispatcher in the API documentation.

  • Prevents the creation of models that have encrypted fields in non-encrypted databases by generating an error when Queryable Encryption is not configured.

The Django MongoDB Backend v6.0.2 release includes the following features, improvements, and fixes:

  • Adds support for the QuerySet.intersection() and QuerySet.difference() methods.

  • Adds support for the nulls_distinct parameter of the UniqueConstraint constructor, which allows you to store only one document that has a NULL value. To learn more, see Specify Unique Constraints in the Create Models guide.

  • Adds the EmbeddedFieldIndex class, which enables indexes on subfields of EmbeddedModelField and EmbeddedModelArrayField values. To learn more, see Embedded Model Subfield Index in the Create Indexes guide.

  • Adds the EmbeddedFieldUniqueConstraint class, which enables unique constraints on subfields of EmbeddedModelField and EmbeddedModelArrayField values. To learn more, see Embedded Field Constraints in the Create Models guide.

  • Fixes a bug that caused an error when calling Model.save() on models with encrypted fields.

The Django MongoDB Backend v6.0.1 release includes the following features, improvements, and fixes:

  • Adds support for Queryable Encryption. To learn more, see the Queryable Encryption tutorial.

  • Adds support for spatial lookups. To learn more, see Query Geospatial Values in the Specify a Query guide.

  • Prevents Index system checks from running twice.

  • Adds exception messages to DatabaseError and IntegrityError exceptions.

  • Fixes QuerySet.defer() and QuerySet.only() behavior so that the methods project the correct fields.

  • Removes the use of $facet from aggregation pipelines, which improves query performance.

Warning

Breaking Changes

The Django MongoDB Backend v6.0.0 release the following breaking changes:

  • Removes support for the django_mongodb_backend.utils.parse_uri() method. Instead, use the DATABASES["HOST"] key. To learn more, see Automatically Configure Database Settings in the Configure Your Database Connection guide.

  • Increase the minimum supported MongoDB version from 6.0 to 7.0.

This section lists the changes introduced in the following patch releases:

The Django MongoDB Backend v5.2.4 release includes the following features, improvements, and fixes:

  • Improves the performance of join operations, which use the $lookup aggregation stage, by pushing complex conditions from the $match stage to the $lookup stage

The Django MongoDB Backend v5.2.3 release includes the following features, improvements, and fixes:

  • Prevents QuerySet.union() queries from duplicating the $project pipeline stage.

  • Updates the Value class to wrap string, dictionary, and tuple values in the $literal operator to prevent MongoDB from interpreting them as expressions. Similarly, queries that update models now wrap values in the $literal operator for the same reason.

  • Simplifies $lookup queries by using localField and foreignField.

The Django MongoDB Backend v5.2.2 release includes the following features, improvements, and fixes:

  • Adds the following SearchIndex arguments, which allow you to create more complex indexes:

    • field_mappings

    • analyzer

    • search_analyzer

    To learn more, see Search Indexes in the Indexes guide.

  • Fixes a KeyError exception that occurred when loading models that contain EmbeddedModel fields using a database converter, if the field isn’t present in the data.

  • Ensures that the db_column argument applies to EmbeddedModel fields.

  • Corrects the search index type of EmbeddedModelField and PolymorphicEmbeddedModelField values from embeddedDocuments to document.

  • Fixes the transaction.atomic() error that occurred when the database connection was not initialized.

  • Deprecates the django_mongodb_backend.utils.parse_uri() method. This method is removed in a future release.

The Django MongoDB Backend v5.2.1 release includes the following features, improvements, and fixes:

  • Adds support for specifying the connection string in the DATABASES["HOST"] key instead of using the django_mongodb_backend.utils.parse_uri() method. To learn more, see Automatically Configure Database Settings in the Configure Your Database Connection guide.

  • Instructs migrations operations that add or delete search indexes to wait until the operation is completed on the server, which prevents conflicts when running multiple operations sequentially.

  • Configures simple queries that use the following operators to use $match instead of $expr, which allows them to use indexes:

    • $eq

    • $in

    • $and

    • $or

    • $gt

    • $gte

    • $lt

    • $lte

Django MongoDB Backend v5.2.0 is the initial general availability (GA) release. To learn more about the GA features, see the Django MongoDB Backend Now Generally Available blog post.

Warning

Breaking Changes

The Django MongoDB Backend v5.2.0 beta 3 release introduces the following breaking change:

  • Removes support for pattern matching lookups on non-string fields. Previously, these lookups cast their input by using the $toString operator. This caused performance issues because MongoDB could not use indexes when running the query.

Warning

Breaking Changes

This version release introduces the following breaking changes:

  • Limits django.db.models.SmallIntegerField and django.db.models.PositiveSmallIntegerField values to 32 bits in forms and model validation.

  • Removes support for database caching. This prevents an attacker who has compromised the database from using pickle-encoded cache values to run arbitrary commands on the application server.

The Django MongoDB Backend v5.2.0 beta 2 release includes the following features, improvements, and fixes:

  • Adds support for MongoDB Search queries. To learn more, see the Run a MongoDB Search Query guide.

  • Adds subquery support for EmbeddedModelArrayField values. To learn more, see Query Embedded Model Array Values in the Specify a Query guide.

  • Adds the options parameter to the django_mongodb_backend.utils.parse_uri() method.

  • Adds support for database transactions. To learn more, see the Transactions and Sessions guide.

  • Adds PolymorphicEmbeddedModelField and PolymorphicEmbeddedModelArrayField fields, which store a model instance or list of model instances that can belong to more than one model class. To learn more, see Store Polymorphic Embedded Model Data in the Create Models guide.

  • Adds GeoDjango support. To learn more, see the Model Geospatial Data guide.

  • Updates QuerySet.explain() to return a string that can be parsed as JSON.

  • Fixes unique constraint generation for the IntegerField and PositiveBigIntegerField fields, which incorrectly allowed duplicate values larger than 32 bits. You must recreate existing unique constraints to use $type: long instead of int.

  • Sends the following fields to MongoDB as bson.int64.Int64 values, which fixes unique constraints on values less than 32 bits:

    • IntegerField

    • BigIntegerField

    • PositiveIntegerField

    • PositiveBigIntegerField

    • DurationField

  • Improves QuerySet performance by removing the low limit on server-side chunking.

  • Improves the performance of join operations, which use the $lookup aggregation stage, by pushing some simple conditions from the $match stage to the $lookup stage.

The Django MongoDB Backend v5.2.0 beta 1 release includes the following features, improvements, and fixes:

  • Adds the EmbeddedModelArrayField field for storing a list of model instances. To learn more, see Store Embedded Model Array Data in the Create Models guide.

  • Fixes a crash that occurred when loading models that have a null ArrayField value and a base_field using a database converter.

Warning

Breaking Changes

This version release introduces the following breaking changes:

  • Increases the minimum supported PyMongo version from 4.6 to 4.7.

  • Removes the conn_max_age parameter of django_mongodb_backend.utils.parse_uri(). Django MongoDB Backend now uses persistent connections by default.

The Django MongoDB Backend v5.2.0 beta 0 release includes the following features, improvements, and fixes:

  • Adds SearchIndex and VectorSearchIndex classes, which allow you to create MongoDB Search and Vector Search indexes. To learn more, see Search Indexes and Vector Search Indexes in the Create Indexes guide.

  • Uses PyMongo's connection pooling by default.

  • Adds support for a field’s custom lookups and transforms in an EmbeddedModelField.

  • Fixes the results of queries that use the tzinfo parameter of the Trunc database functions.

  • Adds support for the QuerySet.dates() and QuerySet.datetimes() methods.

  • Fixes loading of QuerySet results for embedded model fields that use database converters.

This section lists the changes introduced in the following patch releases:

Warning

Breaking Changes

This version release introduces the following breaking change:

  • Removes support for database caching. This prevents an attacker who has compromised the database from using pickle-encoded cache values to run arbitrary commands on the application server.

The Django MongoDB Backend v5.1.0 beta 4 release includes the following features, improvements, and fixes:

  • Fixes a crash that occurred when loading models that have a null ArrayField value, and where the base_field uses a database converter.

  • Improves QuerySet performance by removing the low limit on server-side chunking.

The Django MongoDB Backend v5.1.0 beta 3 release includes the following features, improvements, and fixes:

  • Adds support for a field’s custom lookups and transforms in an EmbeddedModelField

  • Fixes the results of queries that use the tzinfo parameter of the Trunc database functions

  • Adds support for the QuerySet.dates() and QuerySet.datetimes() methods

  • Fixes loading of QuerySet results for embedded model fields that use database converters

Warning

Breaking Changes

This version release introduces the following breaking change:

  • Renames the size parameter for an ArrayField to max_size. The size parameter is now used to enforce fixed-length arrays.

The Django MongoDB Backend v5.1.0 beta 2 release includes the following features, improvements, and fixes:

  • Adds support for database caching. This support is later removed in v5.1.4.

  • Fixes QuerySet.raw_aggregate() field initialization when the document key order does not match the order of the model’s fields.

Warning

Breaking Changes

This version release introduces the following breaking change:

  • ObjectIdAutoField no longer accepts integer values

The Django MongoDB Backend v5.1.0 beta 1 release includes the following features, improvements, and fixes:

  • Adds support for saving nested embedded model forms

  • Fixes persistent database connections

  • Adds support for asynchronous operations

  • Adds the db_name parameter to the django_mongodb_backend.utils.parse_uri() method

  • Adds a django_mongodb_backend.routers.MongoRouter router, which ensures that Django MongoDB Backend does not create collections for embedded models and that the dumpdata command does not include embedded models

Django MongoDB Backend v5.1.0 beta 0 is the initial public preview release. To learn more about the public preview features, see the Official Django MongoDB Backend Now Available in Public Preview blog post.

Back

Migrate Djongo ODM Applications

On this page