-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Inner required
validator fails on $pull
#6972
Comments
Thanks for reporting, will fix |
Thanks @vkarpov15. Are you sure you wanted to tag it as an 'enhancement'? It's a pretty obvious bug, it's causing the |
Good point, we will treat this as a bug |
I've just updated to 5.2.17 and all of my tests are now passing. The repro code from the first post seems to be working correctly too. I don't know how, but it looks like it has been accidentally fixed :) I'm not closing the issue myself in case you'd want to add a regression test. Thanks! |
Glad it works now 👍 |
Required validator for a subdocument field fails on
$pull
even though the field is defined.As a side note, I don't think
required
validators should be called here at all, because the full subdocument isn't present and it's valid to omit fields in$pull
. It's a query.Tested on mongoose 5.2.13
The text was updated successfully, but these errors were encountered: