You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came up with this kind of patch, where I allow developers to fetch and udpate full document and skip the strictCheck when the value of discriminator key is the same as the current model
Prerequisites
Mongoose version
6.6.3
Node.js version
16
MongoDB server version
4.9.1
Description
Hello, I have a throw error on kind, this is a working exemple, event when I set
overwriteDiscriminatorKey
to trueStrictModeError: Field kind is not in schema and strict mode is set to throw.
I think I found the issue castUpdate!L47 where overwriteDiscriminatorKey is check only after strict throw.
it only happens when you pass the updateObj directly as a second params, otherwise when we pass with
$set: updateData
it go through castUpdate.js!L47Steps to Reproduce
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: