Support Topics Documentation Slack YouTube Blog

BackendlessGeoQuery with whereClause issue


(Pavel Razrabotchikov) #1

I want to fetch geopoints. I use this code:

NSString *whereClauseGeo = @"objectId = 





   \'1247C98C-4EDA-3765-FFA4-7DC9B1E90D00





   \' OR objectId = 





   \'B10A4BEE-588A-DB1B-FFDF-436C1387AB00





   \'";
BackendlessGeoQuery *queryGeo = BackendlessGeoQuery queryWithCategories:@[kBaaS_location_category_user]];
queryGeo.whereClause = whereClauseGeo;
            queryGeo.includeMeta = @YES;
backendless.geoService getPoints:queryGeo response:^(BackendlessCollection *collectionGeo) {
     
}
error:^(Fault *fault) {
}

And it fetches empty array. But if I remove the string queryGeo.whereClause = whereClauseGeo; it fetches all the objects (and some of their objectId are exactly the same as in whereClause).

So my conclusion is that whereClause doesn’t work for BackendlessGeoQuery now. Can you fix that?


(Mark Piller) #2

You’re correct geo queries do not work the same way as data queries. Geo queries operate on metadata properties. If you duplicate object id in geo point metadata, you will be able to run the same query.

Regards,
Mark


(Pavel Razrabotchikov) #3

So whereClause is a search in metadata?


(Mark Piller) #4

yes


(Pavel Razrabotchikov) #5

Thank you