title: MongoDB ranged pagination
body: <p>It's said that using skip() for pagination in MongoDB collection with many records is slow and not recommended.</p>
  
  <p>Ranged pagination (based on >_id comparsion) could be used </p>
  
  <pre><code>db.items.find({_id: {$gt: ObjectId('4f4a3ba2751e88780b000000')}});
  </code></pre>
  
  <p>It's good for displaying prev. &amp; next buttons - but it's not very easy to implement when you want to display actual page numbers 1 ... 5 6 7 ... 124 - you need to pre-calculate from which "_id" each page starts.</p>
  
  <p>So I have two questions:</p>
  
  <p>1) When should I start worry about that? When there're "too many records" with noticeable slowdown for skip()? 1 000? 1 000 000?</p>
  
  <p>2) What is the best approach to show links with actual page numbers when using ranged pagination?</p>