Skip to content

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Mar 22, 2018

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.

@codecov
Copy link

codecov bot commented Mar 22, 2018

Codecov Report

Merging #4667 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
...dapters/Storage/Postgres/PostgresStorageAdapter.js 97.24% <100%> (+0.02%) ⬆️
src/Routers/PushRouter.js 92.85% <0%> (-3.58%) ⬇️
src/RestWrite.js 93.23% <0%> (-0.37%) ⬇️
src/Adapters/Storage/Mongo/MongoTransform.js 86.15% <0%> (+0.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a5c05b...897d5bf. Read the comment docs.

@dplewis dplewis requested review from flovilmart and vitaly-t March 23, 2018 01:01
if (fieldValue.$nin) {
createConstraint(_.flatMap(fieldValue.$nin, elt => elt), true);
}
} else if(fieldValue.$in !== undefined) {
Copy link
Contributor

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) {
Copy link
Contributor

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 !==)

@dplewis dplewis merged commit 7108489 into parse-community:master Mar 24, 2018
@dplewis dplewis deleted the pg-gt branch March 24, 2018 22:45
UnderratedDev pushed a commit to UnderratedDev/parse-server that referenced this pull request Mar 21, 2020
* initial test

* more test

* clean up

* added correct errors

* test fix

* $eq null test

* type check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants