tile38
tile38 copied to clipboard
How to access GEOJSON object data with nearby query?
Let's say I've GEO JSON data like this:
{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [6.892769, 79.855802] }, "properties": { "status": "F" } }
Now if I try the following query it's working:
NEARBY driver-info LIMIT 10 DISTANCE POINT 6.892769 79.855802
But I want to look for properties status value for each NEARBY query, how can do that? I tried many methods but nothing work.
Hi @fmr683,
Currently it's not possible to get only the property status
from the results. You must retrieve the entire object and filter on the client side.
Hi tidwall,
Thanks for the quick response, is there a other way that I can save the status parameter and use it in the Nearby query and filter it by where clause? i.e NEARBY driver-info WHERE status = "F" POINT 6.892768 79.855809 2000 (I know this query won't work, but I'm just stating how am I expecting the result). Because I'm dealing with large number of data if I've to do in client end, I'm little afraid it'll be slow for the long run.
Unfortunately there isn't a way to do what you describe. The closest thing is the WHERE clause, but it's only for the numerical FIELD data. But I can see some real benefit for filtering on JSON data, and I'm going to consider this feature in a future release.
Thanks for the quick response.
I would like to ask:
- what are your thougths about this filtering feature - do you still think i would be good?
- do you think about implementing it?
- what would be your workaround for a use case like this?
Thanks!
Any solution for the above issue..? Any example? @tidwall @fmr683.
Help Needed ..!