mysqlbackand

Backand Query with geo point


I am trying to build a query, and pass parameters to it, not sure how can I do it, here is my query

{ "object": "garages", "q": { "lat_long" : { "$within" : [[28.703341,77.130605],10000] } } }

I am passing lat,lng and radios. Now I am able to pass the params, however in response I get lat_long as "lat_long": "AAAAAAEBAAAAVYSbjCqfPEDyzTY3pkVTQA==" .

Is it encoded / serialized? How can I'll get my original values?

Thank you,


Solution

  • Point is stored as a binary value, in order to see your original values you have 2 option

    1. You can manipulate the sql statement like this :

      SELECT CONCAT(X(lat_long), ',', Y(lat_long)) as origin FROM garages WHERE (ST_Distance ..........

    but this way you want be able to edit the nosql tab

    1. When you call REST API With 'GET' on object 'garages' you'll see the values as you oroginaly Posted them