{"action":"created","issue":{"url":"https://api.github.com/repos/Wizcorp/express-rested/issues/50","repository_url":"https://api.github.com/repos/Wizcorp/express-rested","labels_url":"https://api.github.com/repos/Wizcorp/express-rested/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/Wizcorp/express-rested/issues/50/comments","events_url":"https://api.github.com/repos/Wizcorp/express-rested/issues/50/events","html_url":"https://github.com/Wizcorp/express-rested/pull/50","id":182368567,"number":50,"title":"Pagination Implementation","user":{"login":"razzlero","id":8150355,"avatar_url":"https://avatars.githubusercontent.com/u/8150355?v=3","gravatar_id":"","url":"https://api.github.com/users/razzlero","html_url":"https://github.com/razzlero","followers_url":"https://api.github.com/users/razzlero/followers","following_url":"https://api.github.com/users/razzlero/following{/other_user}","gists_url":"https://api.github.com/users/razzlero/gists{/gist_id}","starred_url":"https://api.github.com/users/razzlero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/razzlero/subscriptions","organizations_url":"https://api.github.com/users/razzlero/orgs","repos_url":"https://api.github.com/users/razzlero/repos","events_url":"https://api.github.com/users/razzlero/events{/privacy}","received_events_url":"https://api.github.com/users/razzlero/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":35,"created_at":"2016-10-11T20:40:51Z","updated_at":"2016-10-25T21:25:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Wizcorp/express-rested/pulls/50","html_url":"https://github.com/Wizcorp/express-rested/pull/50","diff_url":"https://github.com/Wizcorp/express-rested/pull/50.diff","patch_url":"https://github.com/Wizcorp/express-rested/pull/50.patch"},"body":"A Pull request for implementing  #36 \r\n\r\nI have coded up a potential implementation of Pagination.\r\nThe parameters Pagenum, PageAfter, and PageSize are now accepted as query string parameters and are processed.\r\nPageafter is given a higher priority than pagenum, so if they are used in the same query string pageAfter is the one which will be used.\r\n\r\nThe changes were primarily made to the createMap function inside lib/operations/collection/get.js .\r\nThe createList function has been modified to first run createMap,and then generate the list form that map. This added a bit of extra processing, but it makes sure the 2 functions return the same results.\r\n\r\nI decided to not sort the results before performing pagination. I thought it would be best to allow users to have control over the order of their results. \r\nCurrently the results should be predictable enough in most cases for pagination to work without the need to sort first. \r\nIn future it might be interesting to add an optional sort parameter though.\r\n\r\nAlso in future it might be a good idea to implement a way of differentiating the query string parameters passed through for searching from the special query string parameters. As it works now if by some slim chance a user has a property called \"pageNum\", \"pageAfter\", or \"pageSize\", and they want to search against that parameter, they won't be able to because of these special functions taking priority."},"comment":{"url":"https://api.github.com/repos/Wizcorp/express-rested/issues/comments/256180540","html_url":"https://github.com/Wizcorp/express-rested/pull/50#issuecomment-256180540","issue_url":"https://api.github.com/repos/Wizcorp/express-rested/issues/50","id":256180540,"user":{"login":"razzlero","id":8150355,"avatar_url":"https://avatars.githubusercontent.com/u/8150355?v=3","gravatar_id":"","url":"https://api.github.com/users/razzlero","html_url":"https://github.com/razzlero","followers_url":"https://api.github.com/users/razzlero/followers","following_url":"https://api.github.com/users/razzlero/following{/other_user}","gists_url":"https://api.github.com/users/razzlero/gists{/gist_id}","starred_url":"https://api.github.com/users/razzlero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/razzlero/subscriptions","organizations_url":"https://api.github.com/users/razzlero/orgs","repos_url":"https://api.github.com/users/razzlero/repos","events_url":"https://api.github.com/users/razzlero/events{/privacy}","received_events_url":"https://api.github.com/users/razzlero/received_events","type":"User","site_admin":false},"created_at":"2016-10-25T21:25:05Z","updated_at":"2016-10-25T21:25:05Z","body":"After doing my research I now realise I was mislead by something I heard before. I heard before that ES6 implemented maps with consistent ordering. I now realise that a new \"map\" datatype was introduced. I thought they were talking about the existing objects.\r\nI have added a default sort which just does a keys.sort();\r\n\r\nSeeing as I have that sorting added I might as well leave it in place for ow. Maybe in a future pull request it can be expanded on for more advanced behaviour.\r\n\r\n"}}
{"actor":{"display_login":"razzlero"}}