Distance-based search on a nested data table

Hey,

I have a Room data table with a one to one relationship with an Address data table. The Address table has ‘coordinates’ column which is a geopoint relationship.

I’m trying to do a distance-based search on the Room data table with following where clause:

distance(52.00, 19.00, address.coordinates.latitude, address.coordinates.longitude) < km(10)

However I get “Invalid where clause: Possible to use only number value or ‘latitude’ or ‘longitude’ in distance function”

How this can be done?

Search on the Address table with

distance(51.00, 19.00, coordinates.latitude, coordinates.longitude) < km(10)

works fine.

Best,
Matt

Hello, Matt!

This is a bug on our side, I shall open an internal task for it.
We shall notify you when it’s fixed.
best regards,
Alex Navara

Thanks Alexandr!

Hello,

Any updates? I’ve the same issue.

Thanks
Michele

Hi Michele,
The issue should be fixed in latest version. What version of Backendless do you use - Cloud, Standalone or Pro?
Please also post example of query you execute.
Artur

Hello,

Thanks for your reply,

I’m using Backendless Cloud and I tried even from the JS SDK and even from the REST console on your website.

this is the query that I use

distance(38,15, place.position.latitude, place.position.longitude ) < km(100)

Of course position is a GeoPoint in fact the query works well if I call it directly like in this way

distance(38,15, position.latitude, position.longitude ) < km(100)

Thanks
Michele

Michele,

What is your application ID?

What is the name of the table where you send the query to?

Regards,
Mark

E218CEB2-9F49-DF20-FF02-AC28A72B1200

I’m querying the Events table that has place as property.

If you try the query directly to Places table it works

Regards
Michele

Michele,

this is rather odd. I was able to verify that the query is not working in your app. I then ran export/import of the data into a new app, and the same query is working there. I’ll assign a developer to look into it. Meanwhile, you could try the same steps to get things going (make sure to link the Places objects to geopoints after the import - it is not done automatically). Also, please do not delete the app where it is broken.

Regards,
Mark