Reputation: 117
I am trying to query for some users, who are within a radius to a given point, or they fulfill some other requirements. For this, I need to OR two queries:
var notOnlyLocal = new Parse.Query(Parse.User);
notOnlyLocal.equalTo('onlyLocal', false);
notOnlyLocal.equalTo('regions', someSelectedRegions);
var onlyLocal = new Parse.Query(Parse.User);
onlyLocal.equalTo('onlyLocal', true);
onlyLocal.withinMiles('location', geoPoint, 100);
return Parse.Query.or(notOnlyLocal, onlyLocal);
And a great answer comes from Parse:
{
"code": 141,
"error": "{\"code\":102,\"message\":\"geo query within or is not supported\"}"
}
Is there a work-around for this kind of situations? There is nothing about this in the documentations. In the caveats they say that an object might contain only 1 location, the near() function limits result to 100 miles radius and points should not equal or exceed the extreme ends of the ranges.
Is there anyone who tried to do something similar, and succeeded? Or any tip for a good work-around?
Upvotes: 0
Views: 123
Reputation:
You can't use this query with "or" statement. You will need to run these as 2 separate queries and then combine the result sets yourself. First execute the notOnlyLocal query and then filter the results by withinMiles clausole
Upvotes: 2