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

feat(document): add validateAllPaths option to validate() and validateSync() #14467

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14414

Summary

Setting validateAllPaths makes Mongoose run validation on all paths in the schema, regardless of change tracking. This is useful because sometimes change tracking makes Mongoose skip running validators that users expect to run, so handy to have a mechanism to run all validators if the end user prefers that approach.

Examples

Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@vkarpov15 vkarpov15 added this to the 8.3 milestone Mar 27, 2024
@vkarpov15 vkarpov15 merged commit 663688f into 8.3 Mar 27, 2024
34 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-14414 branch March 27, 2024 17:32
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.

2 participants