Steps to Reproduce
I spent hours trying to follow the documentation to use the Cloud query api. it is incorrect. To query based on $maxDistance, doc says convert miles to radians. See example here
http://docs.appcelerator.com/cloud/latest/#!/guide/search_query.
That is wrong. The conversion occurs within the API itself, so all one needs is the $maxDistance in miles.
Change the document so that no one else has to pull out their hair trying to figure it out.
Actual Result
Query using $maxDistance value in radians producing zero records
Expected Result
Query using $maxDistance value in radians producing correct number of records
[~ragrawal] can you please clarify the actaul and expected result what you used? right now it says both in radians?
http://docs.mongodb.org/manual/reference/command/geoNear/ should be radians
As an example, I'm using this query:
*Alloy.Globals.MAX_MILES* is set in alloy.js as
Alloy.Globals.MAX_MILES = 10;
No radians used. If I were to set MAX_MILES to10/3959
- the miles-to-radians conversion formula as noted in the API doc - the query returns no records.I think I see where the problem is now. Haven't tested it yet. I think I made an incorrect assumption. I assumed that the ios simulator used valid geo-location coordinates. Apparently, it does not. They point to 1 Stockton St, SF, CA. So, of course, if I calculated miles between points A and B, restricting results to 10 miles, I would get no results because the Point A is in CA and B is in OK. /facepalm. That's what I get for assuming. Please close the ticket.