-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Model.save() doesn't throw StrictModeError #8149
Comments
And it doesn't throw error when trying to modity an immutable property using save() either. |
I tried set() and the result is quite confusing
|
|
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When I set strict to 'throw', it works good on create() and update(). While when I try to set a inexist property to a model and call save(), it doesn't throw a StrictModeError but just drop the property.
If the current behavior is a bug, please provide the steps to reproduce.
Test case:
What is the expected behavior?
It should throw a StrictModeError when using save().
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node.js 10.16.3
Mongoose 5.6.11
MongoDB 3.2.7
The text was updated successfully, but these errors were encountered: