Handle queries with equalTo on objectId and relation conditions (#2472)

* Add test for notEqualTo on relation with equalTo on objectId

* Properly handles queries with equalTo on objectId and relation conditions

This is done by converting shorthand $eq condition to $eq condition instead of clobbering.
This commit is contained in:
Jeremy Louie
2016-08-07 21:58:32 -04:00
committed by Drew
parent cdb46dcb2e
commit f27dff0ae6
2 changed files with 22 additions and 8 deletions

View File

@@ -117,6 +117,16 @@ describe('Parse.Query testing', () => {
let cake = results[0];
expect(cake.id).toBe(cake3.id);
});
}).then(function(){
var query = new Parse.Query(Cake);
// Exclude user1
query.notEqualTo("liker", user1);
// Only cake1
query.equalTo("objectId", cake1.id)
// user1 likes cake1 so this should return no results
return query.find().then(function(results){
equal(results.length, 0);
});
}).then(function(){
done();
})