feat: combine equalTo clauses with clauses
New Pull Request Checklist
- [x] I am not disclosing a vulnerability.
- [x] I am creating this PR in reference to an issue.
Issue Description
equalTo query overrides any existing clauses before it. For e.g.
let q = new Parse.Query('MyClass');
q.greaterThan('age', 10);
q.equalTo('age', 9);
// this will override $gt query and will result something like this where: { age : 9 }
Related issue: #1372
Approach
After following through https://github.com/parse-community/Parse-SDK-JS/issues/1372 and https://github.com/parse-community/parse-php-sdk/issues/476 and https://github.com/parse-community/Parse-SDK-JS/issues/1372#issuecomment-857369919.
Using this.addCondition(key, $eq, value) instead this.where[key], so that equalTo clause can be combined with other clauses and vice-versa.
TODOs before merging
- [x] Add tests
- [ ] Add entry to changelog
- [ ] Add changes to documentation (guides, repository pages, in-code descriptions)
have added only a failing test case.
@sadakchap it seems you have actually also added the fix in this PR, correct? If so, is this ready for review? I would like to add the related dashboard feature with the null filter.
If so, is this ready for review? I would like to add the related dashboard feature with the null filter.
Thanks @mtrezza , I think it still has some failing tests. I will try to fix those during this weekend and will let you know :slightly_smiling_face:
Thanks for opening this pull request!
- 🎉 We are excited about your hands-on contribution!
@mtrezza Thanks for following up & waiting.
About failing test cases. Only Live Query test are failing as they depend on parse-server to fire events. We will need to update parse-server to send events for $eq queries in order to fix all failing test case.
Here's the pr with added support for $eq query for LiveQuery.
@mtrezza @davimacedo @dplewis, would really like to hear your thoughts about it?