-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
PG: Fixes issues comparing to zero or false #4667
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4667 +/- ##
==========================================
- Coverage 92.68% 92.66% -0.02%
==========================================
Files 119 119
Lines 8567 8578 +11
==========================================
+ Hits 7940 7949 +9
- Misses 627 629 +2
Continue to review full report at Codecov.
|
if (fieldValue.$nin) { | ||
createConstraint(_.flatMap(fieldValue.$nin, elt => elt), true); | ||
} | ||
} else if(fieldValue.$in !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use typeof and ‘undefined’ just to make sure
} | ||
} else if(fieldValue.$in !== undefined) { | ||
throw new Parse.Error(Parse.Error.INVALID_JSON, 'bad $in value'); | ||
} else if (fieldValue.$nin != undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, also make sure you use the same inequality operator (!= vs !==)
* initial test * more test * clean up * added correct errors * test fix * $eq null test * type check
Closes: #4653, #4100
Getting rid of
Postgres doesn't support this query type yet
errors and returning proper values.The errors occur when you pass in 0 or false into an if statement.
Let me know if you can think of other queries that I may have missed.