Save doc with async validator on embedded doesn't work (Version 3.9.x) #2589
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Hi all,
I found a new bug on async validator of embedded doc : callback of save method is called before all subdoc are checked.
The best is an example :
On this example, normally output should be :
but I have :
You can see that the save method callback is called immedialy after first sub doc validation, it doesn't wait the second sub doc validation.
This issue happend only if we call cb(false) to invalid a doc, but if I do cb(true), save callback is called at the end (but of course doc is valid ;)) :
Thanks
The text was updated successfully, but these errors were encountered: