isValid virtual generates a crash when updating a nested property #12124
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Prerequisites
Mongoose version
6.4.4
Node.js version
16.15.0
MongoDB server version
5.0.0
Description
Adding a virtual named
isValid
to a schema which have a nested property and updating the property while setting a value to the virtual generates a crash on save.Steps to Reproduce
Here's a reproduction script
which throws this error
The script does not crash if
Expected Behavior
It should not crash, or throw a warning on schema creation if
isValid
should be considered as a reserved keyword.The text was updated successfully, but these errors were encountered: