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

fix: log error on missing required fields when finding with fields selection #533

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

onhate
Copy link
Contributor

@onhate onhate commented Jul 3, 2024

fix #532

@mobsense mobsense merged commit 169fe18 into sensedeep:main Jul 3, 2024
1 check passed
@mobsense
Copy link
Contributor

mobsense commented Jul 3, 2024

Thank you!

@revmischa
Copy link

What should I do if I add a new required field but still have old objects in my DB which lack a value for that field? Now this is giving me errors for those objects.

@mobsense
Copy link
Contributor

mobsense commented Jul 14, 2024

The code will emit a log message but will otherwise work. The alternative is worse where you can have items that don't match the schema and it will return the items silently. This patch addresses that issue.

You can set the {noerror: true} param to suppress the message in 2.7.5.

The real solution is to do a migration to update old items that now don't match the schema.

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 this pull request may close these issues.

Logging errors emitted for find requests with fields selection not including required fields
3 participants