mongoengine - Ignore extra fields for schema validation
For ignoring this error when having extra fields while data loading, set strict
to False
in your meta dictionary.
class User(Document): email = StringField(required=True, unique=True) password = StringField() meta = {'strict': False}
I believe you want to use a DynamicDocument instead of a Document when defining your model and that will allow extra fields in the db schema to be ignored.
I think you want skip schema validation, so when you save your document
document_name.save(validate=False)