I have two columns one is from user and other is to user. now i am checking if current user is in from user or to user. i am querying like the following.
var matQueryFrom = new Parse.Query(Parse.Object.extend("VRMatches"));
var matQueryTo = new Parse.Query(Parse.Object.extend("VRMatches"));
matQueryFrom.equalTo("FROM_USER_OBJECTID",user.id);
matQueryFrom.include("TO_USER");
matQueryTo.equalTo("TO_USER_OBJECTID", user.id);
matQueryTo.include("FROM_USER");
var mainQuery = Parse.Query.or(matQueryFrom, matQueryTo);
i want to get from user if the current user matched to user. OR i want to get to user if the current user matches from user. How can i achieve that or what i am doing wrong?
You need to read the Parse documentation becuase it clearly says:
Note that we do not, however, support GeoPoint or non-filtering constraints (e.g. near, withinGeoBox, limit, skip, ascending/descending, include) in the subqueries of the compound query.
You might be able to add both of the include constraints to the final compound query. Maybe this will work but obviously you will not be able to distinguish which sub query returned which row as the results of both sub queries were Or
ed together:
var matQueryFrom = new Parse.Query("VRMatches");
var matQueryTo = new Parse.Query("VRMatches");
matQueryFrom.equalTo("FROM_USER_OBJECTID",user.id);
matQueryTo.equalTo("TO_USER_OBJECTID", user.id);
var mainQuery = Parse.Query.or(matQueryFrom, matQueryTo);
mainQuery.include("TO_USER");
mainQuery.include("FROM_USER");