You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parse.Query.or ignores query on relation field #432
In the above request toUsers is a column of type relation while toUser is of type pointer. The results simply ignore the 'toUsers' query and returns results matching pointer column. Running these two queries separately works.
Here's the cloud code of the above request:
Parse.Cloud.define("GetActivity", function(request, response) {
var Activity = Parse.Object.extend("Activity");
var User = Parse.Object.extend("User");
var user = request.user;
var queryPings = new Parse.Query(Activity);
queryPings.equalTo("toUsers", user);
var queryFollows = new Parse.Query(Activity);
queryFollows.equalTo("toUser", user);
var query = Parse.Query.or(queryPings, queryFollows);
query.descending("updatedAt");
query.limit(100);
query.find().then(function(activities) {
response.success(activities);
}, function(error) {
response.error(error);
});
});
Just to try out whether compound queries were working or not, I tested it with values on normal string based columns and that worked fine. It seems the problem only occurs on compound queries involving relation type column. I'd also like to add that this code works well with the parse hosted server.
@flovilmart just tried and at least in this particular case it seems to be working well! Will test more in depth later and re-open if I find an issue. Thanks man and as always great job 👍
Activity
IliyaGogolev commentedon Feb 23, 2016
Have similar issue here.
iatek commentedon Feb 24, 2016
+1 Same issue here
flovilmart commentedon Mar 2, 2016
This should be fixed with #769, please test against that version and let me know if that's still occuring
tanmays commentedon Mar 3, 2016
@flovilmart just tried and at least in this particular case it seems to be working well! Will test more in depth later and re-open if I find an issue. Thanks man and as always great job 👍