{"action":"opened","issue":{"url":"https://api.github.com/repos/effektif/effektif/issues/2","labels_url":"https://api.github.com/repos/effektif/effektif/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/effektif/effektif/issues/2/comments","events_url":"https://api.github.com/repos/effektif/effektif/issues/2/events","html_url":"https://github.com/effektif/effektif/issues/2","id":61189567,"number":2,"title":"Paging","user":{"login":"tombaeyens","id":944245,"avatar_url":"https://avatars.githubusercontent.com/u/944245?v=3","gravatar_id":"","url":"https://api.github.com/users/tombaeyens","html_url":"https://github.com/tombaeyens","followers_url":"https://api.github.com/users/tombaeyens/followers","following_url":"https://api.github.com/users/tombaeyens/following{/other_user}","gists_url":"https://api.github.com/users/tombaeyens/gists{/gist_id}","starred_url":"https://api.github.com/users/tombaeyens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tombaeyens/subscriptions","organizations_url":"https://api.github.com/users/tombaeyens/orgs","repos_url":"https://api.github.com/users/tombaeyens/repos","events_url":"https://api.github.com/users/tombaeyens/events{/privacy}","received_events_url":"https://api.github.com/users/tombaeyens/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/effektif/effektif/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-13T19:08:36Z","updated_at":"2015-03-13T19:08:36Z","closed_at":null,"body":"check this paging http://sammaye.wordpress.com/2012/05/25/mongodb-paging-using-ranged-queries-avoiding-skip/\r\nhttp://books.google.be/books?id=uGUKiNkKRJ0C&pg=PA70&lpg=PA70&dq=queries+without+skip&source=bl&ots=h8jzOjeRrh&sig=g-rfrn5aTofQ3VSv_cEbo6jaG58&hl=nl&sa=X&ei=cQVxVP-lD8nwaLj0gIgD&redir_esc=y#v=onepage&q=queries%20without%20skip&f=false\r\n\r\nAvoiding Large Skips Using skip for a small number of documents is fine. Fora large number of results, skip can be slow, since it has to find and then discard all the skipped results. Most databases keep more \r\nmetadata in the index to help with skips, but MongoDB does not yet support this, so large skips should be avoided. Often you can calculate the next query based on the result from the previous one. Paginating results without skip The easiest way to do pagination is to return the first page of results using limit and then return each subsequent page as an offset from the beginning: s n do not use: slow for large skips"}}