-
-
Notifications
You must be signed in to change notification settings - Fork 595
Can not combine equalTo clause with any other clause #1372
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Here's pr #1373 with a failing test case. |
After looking into code for q.greaterThan(age, 0);
q.equalTo(age, 10); // this will override any existing query on that key
// will result in where={age: 10} It seems like And when we try to apply other clauses to equalTo query, q.equalTo(age, 10);
q.greaterThan(age, 0); it was failing at line as equalTo gives Do guys think that it should return
|
I posted this in the PHP SDK because a developer had the same idea you had or similar at almost the same time. parse-community/parse-php-sdk#476 I think they came up with a good solution of using this.addCondition(key, $eq, value) vs this.where[key] just wanted you to know. I’ll look into it more |
Yes, that's a very good solution! q.equalTo(age, 10);
q.equalTo(age); this will result in The way queries are executed, it make sense to me. But, earlier |
New Issue Checklist
Issue Description
Combining
equalTo
clause with any other clause seem to overwriting each other.Steps to reproduce
Actual Outcome
getting a query like this
where={age: {$exists: true}}
or error in 2nd case(using greaterThan)Expected Outcome
where={age: {$exists: true, $eq: null }}
orwhere={age: {$gt: 0, $eq: 10 }}
Environment
Server
4.5.0
Ubuntu
local
Database
MongoDB
4.4
local
Client
3.2.0
Logs
The text was updated successfully, but these errors were encountered: