mongoengine
mongoengine copied to clipboard
Confused about the documentation
I am confused about this line in mongoengine docs
If you use Document and the database contains data that isn’t defined then that data will be stored in the document._data dictionary.
I tested with Document, when loading a document which has a field not defined in schema, mongoengine raises mongoengine.errors.FieldDoesNotExist
Good catch, it should be "If you use DynamicDocument" instead
@bagerard As far as I understand, with DynamicDocument, fields that do not exist in the schema still become attributes of the model instance. I think that this sentence wants to mention Document with strict is set to False.