Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confused about the documentation #2844

Open
kietheros opened this issue Sep 7, 2024 · 2 comments · May be fixed by #2845
Open

Confused about the documentation #2844

kietheros opened this issue Sep 7, 2024 · 2 comments · May be fixed by #2845

Comments

@kietheros
Copy link

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

@bagerard
Copy link
Collaborator

bagerard commented Sep 8, 2024

Good catch, it should be "If you use DynamicDocument" instead

@bagerard bagerard linked a pull request Sep 8, 2024 that will close this issue
@kietheros
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants