{ "id": "144583", "key": "AC-994", "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": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2015-02-13T05:53:44.000+0000", "created": "2015-02-12T19:48:46.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "updated": "2016-03-08T07:37:19.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": "*Whats happening*: Trying to retrieve a set of custom objects with coordinates ordered by \"-updated_at\". \r\n\r\n*What should be happening*: I should get the correct data set that is sorted most recently updated_at.\r\n\r\n*What I believe the problem is*: In ACS if there are coordinates supplied the order parameter gets ignored.\r\n\r\n*Temp fix*: If I remove the coordinates from the query I get the correct data and ordered correctly, the problem here is that I need the data to be within X miles of the user.\r\n\r\n{quote}\r\nCloud.Objects.query({\r\n classname : 'products',\r\n count : true,\r\n skip : _args.skip,\r\n limit : _args.limit,\r\n where : {\r\n \"coordinates\" : {\r\n \"$nearSphere\" : [_args.longitude, _args.latitude],\r\n \"$maxDistance\" : convertToRadians(_args.maxDistanceMiles)\r\n }\r\n },\r\n order : \"-updated_at\"\r\n }, function(e) {\r\n if (e.success) {\r\n _args.success(e);\r\n } else {\r\n _args.failure(e);\r\n }\r\n });\r\n{quote}\r\nOn success i output the skip, limit, and ID of the first object. As you can see the ID is always the same even though I am changing the skip and limit.\r\n{quote}\r\n[INFO] : skip: 0\r\n[INFO] : limit: 4\r\n[INFO] : 54d19fa308c91ec27625e86d\r\n[INFO] : Marker Reached (Dynamic loading)\r\n[INFO] : skip: 4\r\n[INFO] : limit: 4\r\n[INFO] : 54d19fa308c91ec27625e86d\r\n[INFO] : Marker Reached (Dynamic loading)\r\n[INFO] : skip: 8\r\n[INFO] : limit: 4\r\n[INFO] : 54d19fa308c91ec27625e86d\r\n[INFO] : Marker Reached (Dynamic loading)\r\n[INFO] : skip: 12\r\n[INFO] : limit: 4\r\n[INFO] : 54d19fa308c91ec27625e86d\r\n{quote}", "attachment": [], "flagged": false, "summary": "Order parameter does not work when querying ACS custom objects with coordinates", "creator": { "name": "aroyce", "key": "aroyce", "displayName": "Andrew Royce", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "aroyce", "key": "aroyce", "displayName": "Andrew Royce", "active": true, "timeZone": "America/New_York" }, "environment": "ti.cloud version=3.2.7\r\nDeploy type: development\r\nBuilding for target: simulator\r\nBuilding using iOS SDK: 8.1\r\nBuilding for iOS Simulator: iPhone 6\r\nTiSDK : 3.4.1 GA", "comment": { "comments": [ { "id": "343234", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2015-02-13T05:53:31.000+0000", "updated": "2015-02-13T05:53:31.000+0000" }, { "id": "343263", "author": { "name": "aroyce", "key": "aroyce", "displayName": "Andrew Royce", "active": true, "timeZone": "America/New_York" }, "body": "Shuo, unfortunately I do not have the permissions to view the issue. Is there a rough timeframe of when 1.1.9 will be released? Is it possible to get permission to view the issue so I can keep an eye on it and when 1.1.9 gets released?", "updateAuthor": { "name": "aroyce", "key": "aroyce", "displayName": "Andrew Royce", "active": true, "timeZone": "America/New_York" }, "created": "2015-02-13T14:53:07.000+0000", "updated": "2015-02-13T14:53:07.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }