-
-
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
Can't set Boolean to undefined #9275
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Comments
This was introduced by allowing null as a valid property for booleans and it is breaking our code as well. |
Related to this #9253 |
@KevinBusse null has always been a valid value for booleans. This is a regression somehow introduced in 5.9.24. |
Here is a test script for this issue:
|
vkarpov15
added
the
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
label
Jul 27, 2020
vkarpov15
added a commit
that referenced
this issue
Jul 27, 2020
vkarpov15
added
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
and removed
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
labels
Jul 27, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I have
doc.booleanField = true
and I want to remove this key from my document by this below codeBut the result is
doc.booleanField = null
and the key isn't removedWhat is the expected behavior?
It should able to set boolean field to
undefined
and can usedoc.save()
to remove it form docI was able to remove boolean field by this way until mongoose update to version 5.9.24
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node: 10.20.1
Mongoose: 5.9.25
MongoDB: 4.0.18
The text was updated successfully, but these errors were encountered: