{"action":"closed","issue":{"url":"https://api.github.com/repos/jonlil/mongoose-paginate/issues/2","labels_url":"https://api.github.com/repos/jonlil/mongoose-paginate/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/jonlil/mongoose-paginate/issues/2/comments","events_url":"https://api.github.com/repos/jonlil/mongoose-paginate/issues/2/events","html_url":"https://github.com/jonlil/mongoose-paginate/issues/2","id":28894347,"number":2,"title":"How can I tell if the use has return the beginner of collection pages?","user":{"login":"yi","id":9838,"avatar_url":"https://avatars.githubusercontent.com/u/9838?v=3","gravatar_id":"","url":"https://api.github.com/users/yi","html_url":"https://github.com/yi","followers_url":"https://api.github.com/users/yi/followers","following_url":"https://api.github.com/users/yi/following{/other_user}","gists_url":"https://api.github.com/users/yi/gists{/gist_id}","starred_url":"https://api.github.com/users/yi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yi/subscriptions","organizations_url":"https://api.github.com/users/yi/orgs","repos_url":"https://api.github.com/users/yi/repos","events_url":"https://api.github.com/users/yi/events{/privacy}","received_events_url":"https://api.github.com/users/yi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-03-06T16:47:31Z","updated_at":"2015-10-05T11:59:04Z","closed_at":"2015-10-05T11:59:04Z","body":"When I use model.execPagination(), the result will always contain before and after. So I can I tell if the user has reached the beginner (or the end) of the whole collection?\r\n\r\nFollowing is my code, currently it loops from the begining to the end.\r\n```\r\n# list tickets\r\n# GET /workers\r\nexports.index = (req, res, next)->\r\n\r\n  Worker.paginate(req, '_id').execPagination (err, result)->\r\n    return next err if err?\r\n    return next() unless result?\r\n    console.dir result\r\n\r\n    res.render 'workers/index', result\r\n    return\r\n  return\r\n```"}}