I have an data table named donor_profiles which contains relation to geopoint with column name location. The parent for the donot_profiles table is Users table. Now i want to get all the users who are in 1KM radius, for this i am using below query.
distance( %@, %@, donorProfile.location.latitude, donorProfile.location.longitude ) < km(1)
I am using dictionary/map-driven approach for retrieving the data. In this case I am not getting geopoint information in retrieved datastore. Here is the object I am getting
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
{
“___class” = Users;
“__meta” = “{“selectedProperties”:[“lastLogin”,“userStatus”,“dob”,“donorProfile”,“mobile”,“name”,“fullName”,“profileImage”,“ownerId”,“socialAccount”,“email”,“donorProfileStatus”]}”;
created = “2017-12-13 11:34:57 +0000”;
dob = “2017-12-13 11:36:23 +0000”;
donorProfile = {
“___class” = “donor_profiles”;
“__meta” = “{“selectedProperties”:[“bloodGroup”,“lastDonationDate”,“isAvailableForDonation”,“ownerId”]}”;
bloodGroup = “B-”;
created = “2017-12-13 11:36:24 +0000”;
isAvailableForDonation = 1;
lastDonationDate = “2017-12-13 11:36:23 +0000”;
objectId = “9BEA3B33-7C15-4127-FF53-5484329F5E00”;
ownerId = “6094D02C-C6C0-084A-FF05-0722C598F800”;
updated = “<null>”;
};
donorProfileStatus = 1;
email = “”;
fullName = “”;
lastLogin = “2017-12-13 11:35:28 +0000”;
mobile = “”;
objectId = “6094D02C-C6C0-084A-FF05-0722C598F800”;
ownerId = “6094D02C-C6C0-084A-FF05-0722C598F800”;
profileImage = “”;
socialAccount = BACKENDLESS;
updated = “2017-12-13 11:36:25 +0000”;
userStatus = ENABLED;
}
This is what I want
{
“___class” = Users;
“__meta” = “{“selectedProperties”:[“lastLogin”,“userStatus”,“dob”,“donorProfile”,“mobile”,“name”,“fullName”,“profileImage”,“ownerId”,“socialAccount”,“email”,“donorProfileStatus”]}”;
created = “2017-12-13 11:34:57 +0000”;
dob = “2017-12-13 11:36:23 +0000”;
donorProfile = {
“___class” = “donor_profiles”;
“__meta” = “{“selectedProperties”:[“bloodGroup”,“lastDonationDate”,“isAvailableForDonation”,“location”,“ownerId”,“defaultLocation”]}”;
bloodGroup = “B-”;
created = “2017-12-13 11:36:24 +0000”;
defaultLocation = “<null>”;
isAvailableForDonation = 1;
lastDonationDate = “2017-12-13 11:36:23 +0000”;
location = “<GeoPoint> LAT:17.4492740555895, LON:78.36380749512546, distance:0, CATEGORIES:(\n donorsLocation\n), METADATA:{\n info = “Gachibowli Miyapur Road Gachibowli Rajendra Nagar Telangana 500081 India”;\n}, objectId = E0E600F1-E7CF-E39D-FFA4-B4276EEC4E00”;
objectId = “9BEA3B33-7C15-4127-FF53-5484329F5E00”;
ownerId = “6094D02C-C6C0-084A-FF05-0722C598F800”;
updated = “<null>”;
};
donorProfileStatus = 1;
email = “”;
fullName = “”;
lastLogin = “2017-12-13 11:35:28 +0000”;
mobile = “”;
objectId = “6094D02C-C6C0-084A-FF05-0722C598F800”;
ownerId = “6094D02C-C6C0-084A-FF05-0722C598F800”;
profileImage = “”;
socialAccount = BACKENDLESS;
updated = “2017-12-13 11:36:25 +0000”;
userStatus = ENABLED;
}
So, how can i get geopoint information.