{ "id": "126748", "key": "AC-2334", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2014-02-24T22:47:25.000+0000", "created": "2014-02-22T23:10:03.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:21.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "h3. Steps to Reproduce\nI 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.\n\nThat is wrong. The conversion occurs within the API itself, so all one needs is the $maxDistance in miles.\n\nChange the document so that no one else has to pull out their hair trying to figure it out.\n\nh3. Actual Result\nQuery using $maxDistance value in radians producing zero records\n\nh3. Expected Result\nQuery using $maxDistance value in radians producing correct number of records", "attachment": [ { "id": "46136", "filename": ".log", "author": { "name": "madcode", "key": "madcode", "displayName": "Michael Stelly", "active": true, "timeZone": "America/Havana" }, "created": "2014-02-22T23:10:05.000+0000", "size": 732554, "mimeType": "text/plain" }, { "id": "46137", "filename": "diagnostic392057494765325755.log", "author": { "name": "madcode", "key": "madcode", "displayName": "Michael Stelly", "active": true, "timeZone": "America/Havana" }, "created": "2014-02-22T23:10:08.000+0000", "size": 15305, "mimeType": "text/plain" } ], "flagged": false, "summary": "Cloud API doc incorrect", "creator": { "name": "madcode", "key": "madcode", "displayName": "Michael Stelly", "active": true, "timeZone": "America/Havana" }, "subtasks": [], "reporter": { "name": "madcode", "key": "madcode", "displayName": "Michael Stelly", "active": true, "timeZone": "America/Havana" }, "environment": "Titanium Studio 3.2.1", "comment": { "comments": [ { "id": "294314", "author": { "name": "wkong", "key": "wkong", "displayName": "Wei Kong", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~ragrawal] can you please clarify the actaul and expected result what you used? right now it says both in radians?", "updateAuthor": { "name": "wkong", "key": "wkong", "displayName": "Wei Kong", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-02-24T06:25:40.000+0000", "updated": "2014-02-24T06:25:40.000+0000" }, { "id": "294317", "author": { "name": "wkong", "key": "wkong", "displayName": "Wei Kong", "active": false, "timeZone": "America/Los_Angeles" }, "body": "http://docs.mongodb.org/manual/reference/command/geoNear/\n\nshould be radians", "updateAuthor": { "name": "wkong", "key": "wkong", "displayName": "Wei Kong", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-02-24T06:31:43.000+0000", "updated": "2014-02-24T06:31:43.000+0000" }, { "id": "294359", "author": { "name": "madcode", "key": "madcode", "displayName": "Michael Stelly", "active": true, "timeZone": "America/Havana" }, "body": "As an example, I'm using this query:\n{code}\nCloud.Users.query({\n\t\t\tpage : 1,\n\t\t\tper_page : 10,\n\t\t\twhere : {\n\t\t\t\t\"role\" : \"vendor\",\n\t\t\t\t\"cuisine\" : e.source.text,\n\t\t\t\t\"coordinates\" : {\n\t\t\t\t\t\"$exists\" : true,\n\t\t\t\t\t\"$nearSphere\" : userCoords,\n\t\t\t\t\t\"$maxDistance\" : Alloy.Globals.MAX_MILES\n\t\t\t\t}\n\t\t\t}\n{code}\n*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 to {{10/3959}} - the miles-to-radians conversion formula as noted in the API doc - the query returns no records.", "updateAuthor": { "name": "madcode", "key": "madcode", "displayName": "Michael Stelly", "active": true, "timeZone": "America/Havana" }, "created": "2014-02-24T15:50:25.000+0000", "updated": "2014-02-24T15:50:25.000+0000" }, { "id": "294485", "author": { "name": "madcode", "key": "madcode", "displayName": "Michael Stelly", "active": true, "timeZone": "America/Havana" }, "body": "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.\n\nSo, 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.\n\nPlease close the ticket.", "updateAuthor": { "name": "madcode", "key": "madcode", "displayName": "Michael Stelly", "active": true, "timeZone": "America/Havana" }, "created": "2014-02-24T22:09:26.000+0000", "updated": "2014-02-24T22:09:26.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }