adi
Posts: 0
Joined: Tue Jun 26, 2012 8:09 pm

REST API result

this used to work perfectly, i really dont know what changed that it doesnt work anymore.

this is the where caluse of the REST API request:
{"category":{"$in":["glasses","books","electronics","fashion"]}, "company":{"$in":["dr.staff","magnet"]},"location": {"$nearSphere": {"__type": "GeoPoint","latitude": 32.066157,"longitude": 34.777821},"$maxDistanceInKilometers": 500}}

it will return only the records that matches the given category, company and in the given distance of 500 KM.

the location column in the REST DB is of type geolocation. the data of the location rows matches my current location (for debugging) so it should come up.

if i ommit the location column i get a full results set response.
if i try to use the location part, empty results set.

how can i debug it and understand what's wrong?

Thanks
Adi

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

REST API result

If you do a curl request - do you get the right result?

adi
Posts: 0
Joined: Tue Jun 26, 2012 8:09 pm

REST API result

Max, i found the problem and the walk around.
here is what i did:
Deleted the REST class and created a new one from an import file.
when you import new class from CSV file you can't set the field to GeoPoint type, the only available types are string, number and boolean. so deleted the column holding the Geo Points and re-created the column with the correct type. then populated the rows with correct data (GeoPoints).
until now its all REST API stuff and all OK.

but when you go back to tiggzi app and test it will sent the currect JSON request and REST will answer but what i think happens is tiggzi is working with an open session to the previous REST class or its related to the fact the session still exist to the prev class.

when i simply logoff and login to tiggzi all will work...

so i would consider it as a minor defect because there is a walk-around but still this has got to be fixed.

Thanks
Adi

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

REST API result

What backend service are you using?

adi
Posts: 0
Joined: Tue Jun 26, 2012 8:09 pm

REST API result

parse.com

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

REST API result

We don't keep any connections or sessions to the parse.com servers. Probably something was cached on Parse side. The best way to test this is to do a curl request (from command line). In your Tiggzi app (or in Test), it sends a standard REST request.

adi
Posts: 0
Joined: Tue Jun 26, 2012 8:09 pm

REST API result

i will check this tomorrow to make sure where's the problem, on parse side or tiggzi.

thanks Max
Adi

Return to “Issues”