{ "id": "148411", "key": "AC-147", "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": "2015-06-12T06:28:37.000+0000", "created": "2015-06-02T02:35:29.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "updated": "2015-06-12T06:28:37.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14559", "name": "ArrowDB" } ], "description": "Following http://docs.appcelerator.com/arrowdb/latest/#!/guide/search_query for $nearSphere and $maxDistance, fails to find users coordinates 4 miles from current position at even greater maxDistances until reversing Long/Lat to Lat/Long. Since API calls return Users' Coordinates objects reversed from what is seen in ArrowDB's Dashboard I was unsure if this was a bug all around or a documentation issue.\r\n\r\n{code}\r\nTitanium.Geolocation.getCurrentPosition(function(e)\r\n\t{\r\n\t if (e.error) {\r\n\t alert('cannot get your current location');\r\n\t return;\r\n\t }\r\n\t\tCloud.Users.query({\r\n\t\t\tresponse_json_depth: 2,\r\n\t\t page: 1,\r\n\t\t per_page: 100,\r\n\t\t where: { \r\n\t \t\t\"coordinates\":{\"$nearSphere\":[Number(e.coords.longitude), Number(e.coords.latitude)], \"$maxDistance\" : 0.025}\r\n\t } \r\n\t\t}, function (e) {\r\n\t\t if (e.success) {\r\n\t\t alert('Success: ' + e.users.length);\r\n\t\t } else {\r\n\t\t alert('Error:\\n' + ((e.error && e.message) || JSON.stringify(e)));\r\n\t\t }\r\n\t\t});\r\n\t});\r\n{code}", "attachment": [], "flagged": false, "summary": "Clouds.Users.query's $nearSphere has reversed Lat/Long requirements", "creator": { "name": "keylo", "key": "keylo", "displayName": "Keylo E.", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "keylo", "key": "keylo", "displayName": "Keylo E.", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "ArrowDB", "comment": { "comments": [ { "id": "354896", "author": { "name": "keylo", "key": "keylo", "displayName": "Keylo E.", "active": true, "timeZone": "America/Los_Angeles" }, "body": "$nearSphere is working as it should be. \r\nThe confusion was from mistakes I'd made changing Lat/Lon in ArrowDB's Users coordinates, thinking I'd entered them incorrectly because the coordinates object returned by Cloud.users.query was reversed and had no (apparent) way to access individual lat or lon. My appologies.\r\nA means of accessing the returned event.users[0].custom_fields.coordinates.LATITUDE by name would help.\r\n\r\nArrowDB's User Lat/Lon (correct/popular order)\r\n!http://ibin.co/24t0r8VU5rvI!\r\n\r\nreturned coordinates object using Cloud.Users.query method (reversed order)\r\n!http://ibin.co/24t1k5QjI8yc!", "updateAuthor": { "name": "keylo", "key": "keylo", "displayName": "Keylo E.", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-06-11T16:48:37.000+0000", "updated": "2015-06-11T16:48:37.000+0000" }, { "id": "354974", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "User error.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-06-12T06:28:37.000+0000", "updated": "2015-06-12T06:28:37.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }