mongoengine
mongoengine copied to clipboard
A Python Object-Document-Mapper for working with MongoDB
Fix for issue https://github.com/MongoEngine/mongoengine/issues/2429
The mongoengine documentation states that EmbeddedDocuments support being the `primary_key`, which is true, but this breaks if you try to create a `ReferenceField` pointing to such a document. Consider the...
This is driving me crazy. Tested on MongoDB 7.0.2.
```python class User(DynamicDocument): name = StringField() ``` `_id` is the shard key ```python user.modify(name='ok') ``` gets this error ` mongoengine.errors.OperationError: Update failed (Query for sharded findAndModify must contain the shard...
new test package called connections and move related modules in; new related test methods;
As I've been learning how to use the library and googling questions on how to use different commands, I've come across 3 different URLs for the documentation site. Perhaps they...
Fixes issues #2764 and #2308, implements lazy delete rules and delete rules on GenericReferenceFields. To implement lazy delete rules: When delete rules are assigned to a Document that doesn't exist...
I get the following error when trying to add "reverse_delete_rule=db.CASCADE" to a GenericReferenceField: **_AttributeError: 'GenericReferenceField' object has no attribute 'document_type'_** This is my code: `from database.db import db class Movie(db.DynamicDocument):...
MongoEngine will throw a `NotRegistered` exception when a user tries to register a delete rule on a Document that hasn't been defined yet. This is because the delete rule is...
There are two very useful options for DateTimeField in Django: auto_now and auto_now_add. From django docs: """ **auto_now** Automatically set the field to now every time the object is saved....