-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Mongoose Boolean validation not working if a String is provided #4245
Labels
backwards-breaking
enhancement
This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
Milestone
Comments
Yeah unfortunately this is backwards breaking, mongoose will cast anything into a boolean and this is expected behavior. Will make this change for the next major release. |
vkarpov15
added
enhancement
This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
backwards-breaking
and removed
bug?
labels
Jul 11, 2016
vkarpov15
added a commit
that referenced
this issue
Nov 25, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backwards-breaking
enhancement
This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
Given the following schema with a Boolean field:
When trying to save a document, if I supply a random string instead of a Boolean value or "Boolean string" (e.g. "false" or "true" instead of just false/true) for enabled field, the document is still being saved properly, with the Boolean field set to true.
Expected behavior: save operation should throw a ValidationError.
The text was updated successfully, but these errors were encountered: