NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #3170 most downloaded on PyPI
MongoEngine is a Python Object-Document Mapper for working with MongoDB.
Last release 6 months ago
10 Mar 2026
Release timing varies
gaps range from 3 weeks to 1.5 years
Nearly every release is documented
notes for 57 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
78 releases · first in 2013
Remove mentions of mongoengine[dot]org as we no longer own it #2905
Remove mentions of mongoengine[dot]org as we no longer own it #2905
- fixes relted with
fixes relted with
One column per quarter.
bump checkout and python github actions (fix nodejs deprecation warnings)
Full Changelog: v0.29.0...v0.29.1
Merge pull request #2835 from bagerard/prep_release_0_29_0
Merge pull request #2835 from bagerard/prep_release_0_29_0
Prepare release 0.29.0
Fix weakref in EmbeddedDocumentListField (causing brief mem leak in certain circumstances) #2827
Fix pillow deprecation warning related with LANCZOS filter #2824
Allow gt/gte/lt/lte/ne operators to be used with a list as value on ListField #2813
Switch tox to use pytest instead of legacy python setup.py test #2804
Add support for timeseries collection #2661
Add support in tests for MongoDB 7.0, pymongo 4.7 and pymongo 4.8 in the CI #2826
Add support for array_filters in Queryset.modify #2811
Integrate a docker-compose setup for local testing #2555
improve ReferenceField wrong usage detection
Fix no_dereference thread-safetyness #2830
BREAKING CHANGE: max_length in ListField is now keyword only on ListField signature
BREAKING CHANGE: Force field argument of ListField/DictField to be a field instance (e.g ListField(StringField()) instead of ListField(StringField)
Merge pull request #2803 from bagerard/fix_pymongo37
Merge pull request #2803 from bagerard/fix_pymongo37
Fix pymongo37 incompatibility
Merge pull request #2800 from bagerard/bug_no_deref_thread_local
Merge pull request #2800 from bagerard/bug_no_deref_thread_local
Fix bug in mutable thread local related with no_dereference ctx manager
Fix bug related with recent updates to no_dereference context manager #2799
BREAKING CHANGE: no_dereference context manager no longer returns the class in __enter__ #2788 as it was useless and making it look like it was return…
Fix for uuidRepresentation not read when provided in URI #2741
Add option to user array_filters https://www.mongodb.com/docs/manual/reference/operator/update/positional-filtered/ #2769
Fix combination of __raw__ and mongoengine syntax #2773
Add tests against MongoDB 6.0 and MongoDB 7.0 in the pipeline
Fix validate() not being called when inheritance is used in EmbeddedDocument and validate is overriden #2784
Add support for readPreferenceTags in connection parameters #2644
Use estimated_documents_count OR documents_count when count is called, based on the query #2529
Fix no_dereference context manager which wasn't turning off auto-dereferencing correctly in some cases #2788
as it was useless and making it look like it was returning a different class although it was the same. Thus, it must be called like with no_dereference(User): and no longer with no_dereference(User) as ...:
Added __raw__ to ~mongoengine.Queryset.order_by() to allow to provide raw pymongo 'sort' argument and get around some of the limitations #2783
as it interfere with natural returned documents order #2759
Merge pull request #2740 from bagerard/prepare_0_27
Merge pull request #2740 from bagerard/prepare_0_27
Prepare 0.27
Update uuidRepresentation warnings with "unspecified" as the future default (instead of 'standard' previously advertised) #2739
Added mongo_client_class optional parameter to connect() to allow to use an alternative mongo client than pymongo.MongoClient. Typically to support mock mongo libraries like mongomock, montydb, mongita #2729
BREAKING CHANGE: connecting MongoEngine with mongomock should now use the new mongo_client_class For more info, check https://mongoengine-odm.readthedocs.io/guide/mongomock.html
Fix DictField that always gets marked as changed #2606
fix for Queryset.none() that has no effect on update/aggregate / first #2669
Merge pull request #2727 from bagerard/prepare_0_26_0_release
Merge pull request #2727 from bagerard/prepare_0_26_0_release
prepare_0_26_0_release
BREAKING CHANGE: Improved the performance of ~mongoengine.Document.save() by removing the call to ~mongoengine.Document.ensure_indexes unless meta['auto_create_index_on_save'] is set to True. With the default settings, Document indexes will still be created on the fly, during the first usage of the collection (query, insert, etc), they will just not be re-created whenever .save() is called.
Added meta auto_create_index_on_save so you can enable index creation on ~mongoengine.Document.save() (as it was < 0.26.0).
BREAKING CHANGE: remove deprecated method ensure_index (replaced by create_index long time ago).
Addition of Decimal128Field: ~mongoengine.fields.Decimal128Field for accurate representation of Decimals (much better than the legacy field DecimalField). Although it could work to switch an existing DecimalField to Decimal128Field without applying a migration script, it is not recommended to do so (DecimalField uses float/str to store the value, Decimal128Field uses Decimal128).
BREAKING CHANGE: When using ListField(EnumField) or DictField(EnumField), the values weren't always cast into the Enum (#2531)
BREAKING CHANGE (bugfix) Querying ObjectIdField or ComplexDateTimeField with None no longer raise a ValidationError (#2681)
Allow updating a field that has an operator name e.g. "type" with .update(set__type="foo"). It was raising an error previously. #2595
Merge pull request #2718 from bagerard/prepare_release_0_25_0
Merge pull request #2718 from bagerard/prepare_release_0_25_0
improvements for 0 25 0
Support MONGODB-AWS authentication mechanism (with authmechanismproperties) #2507
Bug Fix - distinct query doesn't obey the no_dereference(). #2663
Add tests against Mongo 5.0 in pipeline
Drop support for Python 3.6 (EOL)
Bug fix support for PyMongo>=4 to fix "pymongo.errors.InvalidOperation: Cannot use MongoClient after close" errors. #2627
Bug fix regarding uuidRepresentation that was case sensitive #2650
Bug fix regarding uuidRepresentation that was case sensitive #2650
Don't use deprecated property for emptiness check in queryset base #2633
Allow pymongo<5.0 to be pulled
Don't use deprecated property for emptiness check in queryset base #2633
BREAKING CHANGE: Updates to support pymongo 4.0. Where possible deprecated functionality has been migrated, but additional care should be taken when m…
EnumField improvements: now choices limits the values of an enum to allow
Fix bug that prevented instance queryset from using custom queryset_class #2589
Fix deepcopy of EmbeddedDocument #2202
Introduce a base exception class for MongoEngine exceptions (MongoEngineException). Note that this doesn't concern the pymongo errors #2515
Fix error when using precision=0 with DecimalField #2535
Add support for regex and whole word text search query #2568
Add support for update aggregation pipeline #2578
BREAKING CHANGE: Updates to support pymongo 4.0. Where possible deprecated functionality has been migrated, but additional care should be taken when migrating to pymongo 4.0 as existing code may have been using deprecated features which have now been removed #2614.
For the pymongo migration guide see: https://pymongo.readthedocs.io/en/stable/migrate-to-pymongo4.html.
In addition to the changes in the migration guide, the following is a high level overview of the changes made to MongoEngine when using pymongo 4.0:
limited support of geohaystack indexes has been removed
QuerySet.map_reduce has been migrated from Collection.map_reduce and Collection.inline_map_reduce to use db.command({mapReduce: ..., ...}) and support between the two may need additional verification.
UUIDs are encoded with the pythonLegacy encoding by default instead of the newer and cross platform standard encoding. Existing UUIDs will need to be migrated before changing the encoding, and this should be done explicitly by the user rather than switching to a new default by MongoEngine. This default will change at a later date, but to allow specifying and then migrating to the new format a default json_options has been provided.
Queryset.count has been using Collection.count_documents and transparently falling back to Collection.count when using features that are not supported by Collection.count_documents. Collection.count has been removed and no automatic fallback is possible. The migration guide documents the extended functionality which is no longer supported. Rewrite the unsupported queries or fetch the whole result set and perform the count locally.
Pymongo 4 removed db.authenticate(), on which we were relying for authenticating with username/password. The migration involved switching to providing credentials to MongoClient BUT in case the authSource isn't provided, db.authenticate used to default to authSource=current-database and MongoClient defaults to authSource="admin". Long story short, if you observe authentication issue after migrating, make sure you provide the authSource explicitly. (see #2626)
Bug fix: ignore LazyReferenceFields when clearing _changed_fields #2484
Bug fix: ignore LazyReferenceFields when clearing _changed_fields #2484
Improve connection doc #2481
Bugfix: manually setting SequenceField in DynamicDocument doesn't increment the counter #2471
Bugfix: manually setting SequenceField in DynamicDocument doesn't increment the counter #2471
Add MongoDB 4.2 and 4.4 to CI
Add support for allowDiskUse on querysets #2468
Declare that Py3.5 is not supported in package metadata #2449
Declare that Py3.5 is not supported in package metadata #2449
Moved CI from Travis to Github-Actions
Fix LazyReferenceField dereferencing in embedded documents #2426
Fix LazyReferenceField dereferencing in embedded documents #2426
Fix regarding the recent use of Cursor.__spec in .count() that was interfering with mongomock #2425
Drop support for Python 3.5 by introducing f-strings in the codebase
BREAKING CHANGE: Fix the behavior of Doc.objects.limit(0) which should return all documents (similar to mongodb) #2311
Bug fix in DynamicDocument which is not parsing known fields in constructor like Document do #2412
and Cursor.count that got deprecated in pymongo >= 3.7. This should have a negative impact on performance of count see Issue #2219
Fix a bug that made the queryset drop the read_preference after clone().
Remove Py3.5 from CI as it reached EOL and add Python 3.9
Fix some issues related with db_field/field conflict in constructor #2414
BREAKING CHANGE: Fix the behavior of Doc.objects.limit(0) which should return all documents (similar to mongodb) #2311
just replacing the first item (as usually done when updating 1 item of the list) #2392
Add EnumField: mongoengine.fields.EnumField
Refactoring - Remove useless code related to Document.__only_fields and Queryset.only_fields
Fix query transformation regarding special operators #2365
Bug Fix: Document.save() fails when shard_key is not _id #2154
Remove methods that were deprecated years ago:
ATTENTION: Drop support for Python2
Add Mongo 4.0 to Travis
Fix error when setting a string as a ComplexDateTimeField #2253
Bump development Status classifier to Production/Stable #2232
Improve Queryset.get to avoid confusing MultipleObjectsReturned message in case multiple match are found #630
Fixed a bug causing inaccurate query results, while combining __raw__ and regular filters for the same field #2264
Add support for the elemMatch projection operator in .fields() (e.g BlogPost.objects.fields(elemMatch__comments="test")) #2267
DictField validate failed without default connection (bug introduced in 0.19.0) #2239
name parameter in Field constructor e.g StringField(name="..."), was replaced by db_field
Queryset.slave_okay() was deprecated since pymongo3
dropDups was dropped with MongoDB3
Queryset._ensure_indexes and Queryset.ensure_indexes, the right method to use is Document.ensure_indexes
Added pre-commit for development/CI #2212
Renamed requirements-lint.txt to requirements-dev.txt #2212
Support for setting ReadConcern #2255
DEPRECATION: The interface of QuerySet.aggregate method was changed, it no longer takes an unpacked list of pipeline steps (*pipeline) but simply take…
Tests require Pillow < 7.0.0 as it dropped Python2 support
DEPRECATION: The interface of QuerySet.aggregate method was changed, it no longer takes an unpacked list of pipeline steps (*pipeline) but simply takes the pipeline list just like pymongo.Collection.aggregate does. #2079
BREAKING CHANGE: class_check and read_preference keyword arguments are no longer available when filtering a QuerySet. #2112
BREAKING CHANGE: class_check and read_preference keyword arguments are no longer available when filtering a QuerySet. #2112
Instead of Doc.objects(foo=bar, read_preference=...) use Doc.objects(foo=bar).read_preference(...). - Instead of Doc.objects(foo=bar, class_check=False) use Doc.objects(foo=bar).clear_cls_query(...). - This change also renames the private QuerySet._initial_query attribute to _cls_query.
BREAKING CHANGE: Removed the deprecated format param from QuerySet.explain. #2113
If you catch/use MongoEngineConnectionError in your code, you'll have to rename it.
From now on keyword arguments (e.g. Doc(field_name=value)) are required.
BREAKING CHANGE: A LazyReferenceField is now stored in the _data field of its parent as a DBRef, Document, or EmbeddedDocument (ObjectId is no longer allowed). #2182
Added ability to check if Q or QNode are empty by parsing them to bool.
Instead of Q(name="John").empty use not Q(name="John").
Fix updating/modifying/deleting/reloading a document that's sharded by a field with db_field specified. #2125
Only set no_cursor_timeout when requested (fixes an incompatibility with MongoDB 4.2) #2148
ListField now accepts an optional max_length parameter. #2110
Improve error message related to InvalidDocumentError #2180
Added BulkWriteError to replace NotUniqueError which was misleading in bulk write insert #2152
Added ability to compare Q and Q operations #2204
Added ability to use a db alias on query_counter #2194
Added ability to specify collations for querysets with Doc.objects.collation #2024
Fix updates of a list field by negative index #2094
Switch from nosetest to pytest as test runner #2114
The codebase is now formatted using black. #2109
Documented how pymongo.monitoring can be used to log all queries issued by MongoEngine to the driver.
Replace deprecated PyMongo v2.x methods with their v3.x equivalents in the SequenceField. #2097
Replace deprecated PyMongo v2.x methods with their v3.x equivalents in the SequenceField. #2097
Various code clarity and documentation improvements.
BREAKING CHANGE: Changed the behavior of a custom field validator (i.e validation parameter of a Field). It is now expected to raise a ValidationError…
Drop support for EOL'd MongoDB v2.6, v3.0, and v3.2.
MongoEngine now requires PyMongo >= v3.4. Travis CI now tests against MongoDB v3.4 – v3.6 and PyMongo v3.4 – v3.6. #2017 #2066
Improve performance by avoiding a call to to_mongo in Document.save. #2049
Expose mongoengine.connection.disconnect and mongoengine.connection.disconnect_all.
Fix disconnecting. #566 #1599 #605 #607 #1213 #565
Improve documentation of connect/disconnect.
Fix issue when using multiple connections to the same mongo with different credentials. #2047
connect fails immediately when db name contains invalid characters. #2031 #1718
Fix the default write concern of Document.save that was overwriting the connection write concern. #568
Fix querying on List(EmbeddedDocument) subclasses fields. #1961 #1492
Fix querying on (Generic)EmbeddedDocument subclasses fields. #475
Fix QuerySet.aggregate so that it takes limit and skip value into account. #2029
Generate unique indices for SortedListField and EmbeddedDocumentListFields. #2020
BREAKING CHANGE: Changed the behavior of a custom field validator (i.e validation parameter of a Field). It is now expected to raise a ValidationError instead of returning True/False. #2050
Calling connect 2 times with the same alias and different parameter will raise an error (should call disconnect first).
disconnect now clears mongoengine.connection._connection_settings.
disconnect now clears the cached attribute Document._collection.
BREAKING CHANGE: EmbeddedDocument.save & .reload no longer exist. #1552
POTENTIAL BREAKING CHANGE: All result fields are now passed, including internal fields (_cls, _id) when using QuerySet.as_pymongo. #1976
POTENTIAL BREAKING CHANGE: All result fields are now passed, including internal fields (_cls, _id) when using QuerySet.as_pymongo. #1976
Document a BREAKING CHANGE introduced in 0.15.3 and not reported at that time. #1995
DEPRECATION: EmbeddedDocument.save & .reload are marked as deprecated and will be removed in a next version of MongoEngine. #1552
Fix QuerySet.only working improperly after using QuerySet.count of the same instance of a QuerySet.
Fix batch_size that was not copied when cloning a QuerySet object. #2011
Fix InvalidStringData error when using modify on a BinaryField. #1127
Fix test suite and CI to support MongoDB v3.4. #1445
Fix reference fields querying the database on each access if value contains orphan DBRefs.
Fix $push with the $position operator not working with lists in embedded documents. #1965
Fix $push with the $position operator not working with lists in embedded documents. #1965
Fix Document.save that fails when called with write_concern=None (regression of 0.16.1). #1958
Fix Document.save that fails when called with write_concern=None (regression of 0.16.1). #1958
Remove PyMongo's deprecated Collection.save method and use Collection.insert_one instead. #1899
Fix _cls that is not set properly in the Document constructor (regression). #1950
Fix a bug in the _delta method - update of a ListField depends on an unrelated dynamic field update. #1733
Remove PyMongo's deprecated Collection.save method and use Collection.insert_one instead. #1899
EmbeddedDocumentField will no longer accept references to Document classes in its constructor. #1661
EmbeddedDocumentField will no longer accept references to Document classes in its constructor. #1661
Get rid of the basecls parameter from the DictField constructor (dead code). #1876
Default value of the ComplexDateTime field is now None (and no longer the current datetime). #1368
Fix an unhashable TypeError when referencing a Document with a compound key in an EmbeddedDocument. #1685
Fix a bug where an EmbeddedDocument with the same id as its parent would not be tracked for changes. #1768
Fix the fact that a bulk QuerySet.insert was not setting primary keys of inserted document instances. #1919
Fix a bug when referencing an abstract class in a ReferenceField. #1920
Allow modifications to the document made in pre_save_post_validation to be taken into account. #1202
Replace MongoDB v2.4 tests in Travis CI with MongoDB v3.2. #1903
Fix side effects of using QuerySet.no_dereference on other documents. #1677
Fix TypeError when using lazy Django translation objects as translated choices. #1879
Improve Python 2-3 codebase compatibility. #1889
Fix support for changing the default value of the ComplexDateTime field. #1368
Improve error message in case an EmbeddedDocumentListField receives an EmbeddedDocument instance instead of a list. #1877
Fix the inc and dec operators for the DecimalField. #1517 #1320
Ignore killcursors queries in query_counter context manager. #1869
Fix the fact that query_counter was modifying the initial profiling level in case it was != 0. #1870
Repair the no_sub_classes context manager + fix the fact that it was swallowing exceptions. #1865
Fix index creation error that was swallowed by hasattr under Python 2. #1688
QuerySet.limit function behaviour: Passing 0 as parameter will return all the documents in the cursor. #1611
Bulk insert updates the IDs of the input documents instances. #1919
Fix a harmless bug related to GenericReferenceField where modifications in the generic-referenced document were tracked in the parent. #1934
Improve validation of the BinaryField. #273
Implement lazy regex compiling in Field classes to improve import mongoengine performance. #1806
Update GridFSProxy.__str__ so that it would always print both the filename and grid_id. #710
Add __repr__ to Q and QCombination classes. #1843
Fix bug in the BaseList.__iter__ operator (was occuring when modifying a BaseList while iterating over it). #1676
Add a DateField. #513
Various improvements to the documentation.
Various code quality improvements.
Queryset.update/update_one methods now return an UpdateResult when full_result=True is provided and no longer a dict. #1491
Queryset.update/update_one methods now return an UpdateResult when full_result=True is provided and no longer a dict. #1491
Improve LazyReferenceField and GenericLazyReferenceField with nested fields. #1704
Fix the subfield resolve error in generic_emdedded_document query. #1651 #1652
Use each modifier only with $position. #1673 #1675
Fix validation errors in the GenericEmbeddedDocumentField. #1067
Update cached fields when a fields argument is given. #1712
Add a db parameter to register_connection for compatibility with connect.
Use PyMongo v3.x's insert_one and insert_many in Document.insert. #1491
Use PyMongo v3.x's update_one and update_many in Document.update and QuerySet.update. #1491
Fix how reload(fields) affects changed fields. #1371
Fix a bug where the read-only access to the database fails when trying to create indexes. #1338
Add LazyReferenceField and GenericLazyReferenceField. #1230
Add LazyReferenceField and GenericLazyReferenceField. #1230
Nothing published for this version
POTENTIAL BREAKING CHANGE: Added Unicode support to the EmailField, see docs/upgrade.rst for details.
POTENTIAL BREAKING CHANGE: Added Unicode support to the EmailField, see docs/upgrade.rst for details.
POTENTIAL BREAKING CHANGE: Fix limit/skip/hint/batch_size chaining. #1476
POTENTIAL BREAKING CHANGE: Fix limit/skip/hint/batch_size chaining. #1476
POTENTIAL BREAKING CHANGE: Change a public QuerySet.clone_into method to a private QuerySet._clone_into. #1476
Fix the way Document.objects.create works with duplicate IDs. #1485
Fix connecting to a replica set with PyMongo 2.x. #1436
Fix using sets in field choices. #1481
Fix deleting items from a ListField. #1318
Fix an obscure error message when filtering by field__in=non_iterable. #1237
Fix behavior of a dec update operator. #1450
Add a rename update operator. #1454
Add validation for the db_field parameter. #1448
Fix the error message displayed when querying an EmbeddedDocumentField by an invalid value. #1440
Fix the error message displayed when validating Unicode URLs. #1486
Raise an error when trying to save an abstract document. #1449
BREAKING CHANGE: Rename ConnectionError to MongoEngineConnectionError since the former is a built-in exception name in Python v3.x. #1428
BREAKING CHANGE: Rename ConnectionError to MongoEngineConnectionError since the former is a built-in exception name in Python v3.x. #1428
BREAKING CHANGE: Drop Python v2.6 support. #1428
BREAKING CHANGE: from mongoengine.base import ErrorClass won't work anymore for any error from mongoengine.errors (e.g. ValidationError). Use from mongoengine.errors import ErrorClass instead. #1428
BREAKING CHANGE: Accessing a broken reference will raise a DoesNotExist error. In the past it used to return None. #1334
Fix absent rounding for the DecimalField when force_string is set. #1103
Nothing published for this version
Fix a bug where a dynamic doc has an index inside a dict field. #1278
Drop Python 3.2 support #1390
Fix a bug where a dynamic doc has an index inside a dict field. #1278
Fix: ListField minus index assignment does not work. #1128
Fix cascade delete mixing among collections. #1224
Add signal_kwargs argument to Document.save, Document.delete and BaseQuerySet.insert to be passed to signals calls. #1206
Raise OperationError when trying to do a drop_collection on document with no collection set.
Fix a bug where a count on ListField of EmbeddedDocumentField fails. #1187
Fix LongField values stored as int32 in Python 3. #1253
MapField now handles unicode keys correctly. #1267
ListField now handles negative indicies correctly. #1270
Fix an AttributeError when initializing an EmbeddedDocument with positional args. #681
Fix a no_cursor_timeout error with PyMongo v3.x. #1304
Replace map-reduce based QuerySet.sum/average with aggregation-based implementations. #1336
Fix support for __ to escape field names that match operators' names in update. #1351
Fix BaseDocument._mark_as_changed. #1369
Add support for pickling QuerySet instances. #1397
Fix connecting to a list of hosts. #1389
Fix a bug where accessing broken references wouldn't raise a DoesNotExist error. #1334
Fix not being able to specify use_db_field=False on ListField(EmbeddedDocumentField) instances. #1218
Improvements to the dictionary field's docs. #1383
Add support for mocking MongoEngine based on mongomock. #1151
Add support for mocking MongoEngine based on mongomock. #1151
Fix not being able to run tests on Windows. #1153
Allow creation of sparse compound indexes. #1114
Fix for reloading of strict with special fields. #1156
Fix for reloading of strict with special fields. #1156
SaveConditionError is now importable from the top level package. #1165
SaveConditionError is now importable from the top level package. #1165
Add a QuerySet.upsert_one method. #1157
Fix infinite recursion with cascade delete rules under specific conditions. #1046
Fix infinite recursion with cascade delete rules under specific conditions. #1046
Fix CachedReferenceField bug when loading cached docs as DBRef but failing to save them. #1047
Fix ignored chained options. #842
Document.save's save_condition error raises a SaveConditionError exception. #1070
Fix Document.reload for the DynamicDocument. #1050
StrictDict & SemiStrictDict are shadowed at init time. #1105
Fix ListField negative index assignment not working. #1119
Remove code that marks a field as changed when the field has a default value but does not exist in the database. #1126
Remove test dependencies (nose and rednose) from install dependencies. #1079
Recursively build a query when using the elemMatch operator. #1130
Fix instance back references for lists of embedded documents. #1131
Removed get_or_create() deprecated since 0.8.0. #300
Django support was removed and will be available as a separate extension. #958
Allow to load undeclared field with meta attribute 'strict': False #957
Support for PyMongo 3+ #946
Removed get_or_create() deprecated since 0.8.0. #300
Improve Document._created status when switch collection and db #1020
Queryset update doesn't go through field validation #453
Added support for specifying authentication source as option authSource in URI. #967
Fixed mark_as_changed to handle higher/lower level fields changed. #927
ListField of embedded docs doesn't set the _instance attribute when iterating over it #914
Support += and *= for ListField #595
Use sets for populating dbrefs to dereference
Fixed unpickled documents replacing the global field's list. #888
Fixed storage of microseconds in ComplexDateTimeField and unused separator option. #910
Don't send a "cls" option to ensureIndex (related to https://jira.mongodb.org/browse/SERVER-769)
Fix for updating sorting in SortedListField. #978
Added __ support to escape field name in fields lookup keywords that match operators names #949
Fix for issue where FileField deletion did not free space in GridFS.
No_dereference() not respected on embedded docs containing reference. #517
Document save raise an exception if save_condition fails #1005
Fixes some internal _id handling issue. #961
Updated URL and Email Field regex validators, added schemes argument to URLField validation. #652
Capped collection multiple of 256. #1011
Added BaseQuerySet.aggregate_sum and BaseQuerySet.aggregate_average methods.
Fix for delete with write_concern {'w': 0}. #1008
Allow dynamic lookup for more than two parts. #882
Added support for min_distance on geo queries. #831
Allow to add custom metadata to fields #705
Update FileField when creating a new file #714
Update FileField when creating a new file #714
Added EmbeddedDocumentListField for Lists of Embedded Documents. #826
ComplexDateTimeField should fall back to None when null=True #864
Request Support for $min, $max Field update operators #863
BaseDict does not follow setdefault #866
Add support for $type operator # 766
Fix tests for pymongo 2.8+ #877
No module named 'django.utils.importlib' (Django dev) #872
Field Choices Now Accept Subclasses of Documents
Ensure Indexes before Each Save #812
Generate Unique Indices for Lists of EmbeddedDocuments #358
Sparse fields #515
write_concern not in params of Collection#remove #801
Better BaseDocument equality check when not saved #798
OperationError: Shard Keys are immutable. Tried to update id even though the document is not yet saved #771
with_limit_and_skip for count should default like in pymongo #759
Fix storing value of precision attribute in DecimalField #787
Set attribute to None does not work (at least for fields with default values) #734
Querying by a field defined in a subclass raises InvalidQueryError #744
Add Support For MongoDB 2.6.X's maxTimeMS #778
abstract shouldn't be inherited in EmbeddedDocument # 789
Allow specifying the '_cls' as a field for indexes #397
Stop ensure_indexes running on a secondaries unless connection is through mongos #746
Not overriding default values when loading a subset of fields #399
Saving document doesn't create new fields in existing collection #620
Added Queryset.aggregate wrapper to aggregation framework #703
Added support to show original model fields on to_json calls instead of db_field #697
Added Queryset.search_text to Text indexes searchs #700
Fixed tests for Django 1.7 #696
Follow ReferenceFields in EmbeddedDocuments with select_related #690
Added preliminary support for text indexes #680
Added elemMatch operator as well - match is too obscure #653
Added support for progressive JPEG #486 #548
Allow strings to be used in index creation #675
Fixed EmbeddedDoc weakref proxy issue #592
Fixed nested reference field distinct error #583
Fixed change tracking on nested MapFields #539
Dynamic fields in embedded documents now visible to queryset.only() / qs.exclude() #425 #507
Add authentication_source option to register_connection #178 #464 #573 #580 #590
Implemented equality between Documents and DBRefs #597
Fixed ReferenceField inside nested ListFields dereferencing problem #368
Added the ability to reload specific document fields #100
Added db_alias support and fixes for custom map/reduce output #586
post_save signal now has access to delta information about field changes #594 #589
Don't query with $orderby for qs.get() #600
Fix id shard key save issue #636
Fixes issue with recursive embedded document errors #557
Fix clear_changed_fields() clearing unsaved documents bug #602
Removing support for Django 1.4.x, pymongo 2.5.x, pymongo 2.6.x.
Removing support for Python < 2.6.6
Fixed $maxDistance location for geoJSON $near queries with MongoDB 2.6+ #664
QuerySet.modify() and Document.modify() methods to provide find_and_modify() like behaviour #677 #773
Added support for the using() method on a queryset #676
PYPY support #673
Connection pooling #674
Avoid to open all documents from cursors in an if stmt #655
Ability to clear the ordering #657
Raise NotUniqueError in Document.update() on pymongo.errors.DuplicateKeyError #626
Slots - memory improvements #625
Fixed incorrectly split a query key when it ends with "_" #619
Geo docs updates #613
Workaround a dateutil bug #608
Conditional save for atomic-style operations #511
Allow dynamic dictionary-style field access #559
Increase email field length to accommodate new TLDs #726
index_cls is ignored when deciding to set _cls as index prefix #733
Make 'db' argument to connection optional #737
Allow atomic update for the entire DictField #742
Added MultiPointField, MultiLineField, MultiPolygonField
Fix multiple connections aliases being rewritten #748
Fixed a few instances where reverse_delete_rule was written as reverse_delete_rules. #791
Make in_bulk() respect no_dereference() #775
Handle None from model __str__; Fixes #753 #754
_get_changed_fields fix for embedded documents with id field. #925
Nothing published for this version
Calling reload on deleted / nonexistent documents raises DoesNotExist
Calling reload on deleted / nonexistent documents raises DoesNotExist (#538)
Stop ensure_indexes running on a secondaries (#555)
Fix circular import issue with django auth (#531) (#545)
- Fix django auth import
Fix django auth import (#531)
Fix multi level nested fields getting marked as changed
Fix multi level nested fields getting marked as changed (#523)
Django 1.6 login fix (#522) (#527)
Django 1.6 session fix (#509)
EmbeddedDocument._instance is now set when setting the attribute (#506)
Fixed EmbeddedDocument with ReferenceField equality issue (#502)
Fixed GenericReferenceField serialization order (#499)
Fixed count and none bug (#498)
Fixed bug with .only() and DictField with digit keys (#496)
Added user_permissions to Django User object (#491, #492)
Fix updating Geo Location fields (#488)
Fix handling invalid dict field value (#485)
Added app_label to MongoUser (#484)
Use defaults when host and port are passed as None (#483)
Fixed distinct casting issue with ListField of EmbeddedDocuments (#470)
Fixed Django 1.6 sessions (#454, #480)
Remove database name necessity in uri connection schema
Remove database name necessity in uri connection schema (#452)
Fixed "$pull" semantics for nested ListFields (#447)
Allow fields to be named the same as query operators (#445)
Updated field filter logic - can now exclude subclass fields (#443)
Fixed dereference issue with embedded listfield referencefields (#439)
Fixed slice when using inheritance causing fields to be excluded (#437)
Fixed ._get_db() attribute after a Document.switch_db() (#441)
Dynamic Fields store and recompose Embedded Documents / Documents correctly (#449)
Handle dynamic fieldnames that look like digits (#434)
Added get_user_document and improve mongo_auth module (#423)
Added str representation of GridFSProxy (#424)
Update transform to handle docs erroneously passed to unset (#416)
Fixed indexing - turn off _cls (#414)
Fixed dereference threading issue in ComplexField.__get__ (#412)
Fixed QuerySetNoCache.count() caching (#410)
Don't follow references in _get_changed_fields (#422, #417)
Allow args and kwargs to be passed through to_json (#420)
Fixed EmbeddedDocuments with id also storing _id
Fixed EmbeddedDocuments with id also storing _id (#402)
Added get_proxy_object helper to filefields (#391)
Added QuerySetNoCache and QuerySet.no_cache() for lower memory consumption (#365)
Fixed sum and average mapreduce dot notation support (#375, #376, #393)
Fixed as_pymongo to return the id (#386)
Document.select_related() now respects db_alias (#377)
Reload uses shard_key if applicable (#384)
Dynamic fields are ordered based on creation and stored in _fields_ordered (#396)
Fixed pickling dynamic documents _dynamic_fields (#387)
Fixed ListField setslice and delslice dirty tracking (#390)
Added Django 1.5 PY3 support (#392)
Added match ($elemMatch) support for EmbeddedDocuments (#379)
Fixed weakref being valid after reload (#374)
Fixed queryset.get() respecting no_dereference (#373)
Added full_result kwarg to update (#380)
Fixed cascading saves which weren't turned off as planned
Added compare_indexes helper (#361)
Fixed cascading saves which weren't turned off as planned (#291)
Fixed Datastructures so instances are a Document or EmbeddedDocument (#363)
Improved cascading saves write performance (#361)
Fixed ambiguity and differing behaviour regarding field defaults (#349)
ImageFields now include PIL error messages if invalid error (#353)
Added lock when calling doc.Delete() for when signals have no sender (#350)
Reload forces read preference to be PRIMARY (#355)
Querysets are now lest restrictive when querying duplicate fields (#332, #333)
FileField now honouring db_alias (#341)
Removed customised __set__ change tracking in ComplexBaseField (#344)
Removed unused var in _get_changed_fields (#347)
Added pre_save_post_validation signal (#345)
DateTimeField now auto converts valid datetime isostrings into dates (#343)
DateTimeField now uses dateutil for parsing if available (#343)
Fixed Doc.objects(read_preference=X) not setting read preference (#352)
Django session ttl index expiry fixed (#329)
Fixed pickle.loads (#342)
Documentation fixes
Fixed Python 2.6 django auth importlib issue
Fixed Python 2.6 django auth importlib issue (#326)
Fixed pickle unsaved document regression (#327)
Fixed querying ReferenceField custom_id
Fixed querying ReferenceField custom_id (#317)
Fixed pickle issues with collections (#316)
Added get_next_value preview for SequenceFields (#319)
Added no_sub_classes context manager and queryset helper (#312)
Querysets now utilises a local cache
Changed __len__ behaviour in the queryset (#247, #311)
Fixed querying string versions of ObjectIds issue with ReferenceField (#307)
Added $setOnInsert support for upserts (#308)
Upserts now possible with just query parameters (#309)
Upserting is the only way to ensure docs are saved correctly (#306)
Fixed register_delete_rule inheritance issue
Fix cloning of sliced querysets (#303)
Fixed update_one write concern (#302)
Updated minimum requirement for pymongo to 2.5
Add support for new geojson fields, indexes and queries (#299)
If values cant be compared mark as changed (#287)
Ensure as_pymongo() and to_json honour only() and exclude() (#293)
Document serialization uses field order to ensure a strict order is set (#296)
DecimalField now stores as float not string (#289)
UUIDField now stores as a binary by default (#292)
Added Custom User Model for Django 1.5 (#285)
Cascading saves now default to off (#291)
ReferenceField now store ObjectId's by default rather than DBRef (#290)
Added ImageField support for inline replacements (#86)
Added SequenceField.set_next_value(value) helper (#159)
Updated .only() behaviour - now like exclude it is chainable (#202)
Added with_limit_and_skip support to count() (#235)
Objects queryset manager now inherited (#256)
Updated connection to use MongoClient (#262, #274)
Fixed db_alias and inherited Documents (#143)
Documentation update for document errors (#124)
Deprecated get_or_create (#35)
Updated inheritable objects created by upsert now contain _cls (#118)
Added support for creating documents with embedded documents in a single operation (#6)
Added to_json and from_json to Document (#1)
Added to_json and from_json to QuerySet (#131)
Updated index creation now tied to Document class (#102)
Added none() to queryset (#127)
Updated SequenceFields to allow post processing of the calculated counter value (#141)
Added clean method to documents for pre validation data cleaning (#60)
Added support setting for read prefrence at a query level (#157)
Added _instance to EmbeddedDocuments pointing to the parent (#139)
Inheritance is off by default (#122)
Remove _types and just use _cls for inheritance (#148)
Only allow QNode instances to be passed as query objects (#199)
Dynamic fields are now validated on save (#153) (#154)
Added support for multiple slices and made slicing chainable. (#170) (#190) (#191)
Fixed GridFSProxy __getattr__ behaviour (#196)
Fix Django timezone support (#151)
Simplified Q objects, removed QueryTreeTransformerVisitor (#98) (#171)
FileFields now copyable (#198)
Querysets now return clones and are no longer edit in place (#56)
Added support for $maxDistance (#179)
Uses getlasterror to test created on updated saves (#163)
Fixed inheritance and unique index creation (#140)
Fixed reverse delete rule with inheritance (#197)
Fixed validation for GenericReferences which haven't been dereferenced
Added switch_db context manager (#106)
Added switch_db method to document instances (#106)
Added no_dereference context manager (#82) (#61)
Added switch_collection context manager (#220)
Added switch_collection method to document instances (#220)
Added support for compound primary keys (#149) (#121)
Fixed overriding objects with custom manager (#58)
Added no_dereference method for querysets (#82) (#61)
Undefined data should not override instance methods (#49)
Added Django Group and Permission (#142)
Added Doc class and pk to Validation messages (#69)
Fixed Documents deleted via a queryset don't call any signals (#105)
Added the "get_decoded" method to the MongoSession class (#216)
Fixed invalid choices error bubbling (#214)
Updated Save so it calls $set and $unset in a single operation (#211)
Fixed inner queryset looping (#204)
Fix UnicodeEncodeError for dbref
Fix UnicodeEncodeError for dbref (#278)
Allow construction using positional parameters (#268)
Updated EmailField length to support long domains (#243)
Added 64-bit integer support (#251)
Added Django sessions TTL support (#224)
Fixed issue with numerical keys in MapField(EmbeddedDocumentField()) (#240)
Fixed clearing _changed_fields for complex nested embedded documents (#237, #239, #242)
Added "id" back to _data dictionary (#255)
Only mark a field as changed if the value has changed (#258)
Explicitly check for Document instances when dereferencing (#261)
Fixed order_by chaining issue (#265)
Added dereference support for tuples (#250)
Resolve field name to db field name when using distinct(#260, #264, #269)
Added kwargs to doc.save to help interop with django (#223, #270)
Fixed cloning querysets in PY3
Int fields no longer unset in save when changed to 0 (#272)
Fixed ReferenceField query chaining bug fixed (#254)
Better fix handling for old style _types
Better fix handling for old style _types
Embedded SequenceFields follow collection naming convention
Fix sequence fields in embedded documents
Fix sequence fields in embedded documents (#166)
Fix query chaining with .order_by() (#176)
Added optional encoding and collection config for Django sessions (#180, #181, #183)
Fixed EmailField so can add extra validation (#173, #174, #187)
Fixed bulk inserts can now handle custom pk's (#192)
Added as_pymongo method to return raw or cast results from pymongo (#193)
ReferenceFields with dbref=False use ObjectId instead of strings (#134) See ticket for upgrade notes
ReferenceFields with dbref=False use ObjectId instead of strings (#134) See ticket for upgrade notes (#134)
Fixed index inheritance issues - firmed up testcases
Fixed index inheritance issues - firmed up testcases (#123) (#125)
Reverted EmbeddedDocuments meta handling - now can turn off inheritance
Reverted EmbeddedDocuments meta handling - now can turn off inheritance (#119)
Update index spec generation so its not destructive
Update index spec generation so its not destructive (#113)
- Fixed index spec inheritance
Fixed index spec inheritance (#111)
Updated queryset.delete so you can use with skip / limit
Updated queryset.delete so you can use with skip / limit (#107)
Updated index creation allows kwargs to be passed through refs (#104)
Fixed Q object merge edge case (#109)
Fixed reloading on sharded documents (hmarr/mongoengine#569)
Added NotUniqueError for duplicate keys (#62)
Added custom collection / sequence naming for SequenceFields (#92)
Fixed UnboundLocalError in composite index with pk field (#88)
Updated ReferenceField's to optionally store ObjectId strings this will become the default in 0.8 (#89)
Added FutureWarning - save will default to cascade=False in 0.8
Added example of indexing embedded document fields (#75)
Fixed ImageField resizing when forcing size (#80)
Add flexibility for fields handling bad data (#78)
Embedded Documents no longer handle meta definitions
Use weakref proxies in base lists / dicts (#74)
Improved queryset filtering (hmarr/mongoengine#554)
Fixed Dynamic Documents and Embedded Documents (hmarr/mongoengine#561)
Fixed abstract classes and shard keys (#64)
Fixed Python 2.5 support
Added Python 3 support (thanks to Laine Heron)
Your coding agent can read these notes before it upgrades. Set up the MCP server →