Custom validator on nested subdocument array field is not running on save() #11672
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Do you want to request a feature or report a bug?
Report a bug
What is the current behavior?
When setting the field of a nested subdocument array, the field validator does not run when calling
save()
. This only happens when the document already exists in the DB and is being updated.If the current behavior is a bug, please provide the steps to reproduce.
Note that the repro below requires a DB connection
What is the expected behavior?
Validation runs properly.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Mongoose: 6.3.0
Node.js: 16.8
MongoDB: 5.0
Note that this started happening when I upgraded from Mongoose 6.1.6 to 6.3.0
The text was updated successfully, but these errors were encountered: