title: How to do pagination using range queries in MongoDB?
body: <p>I'm probably missing something since I'm still learning the ins and 
  outs of MongoDB, but I need help with paging a collection. </p>
  
  <p>I have a collection that has a list of names. </p>
  
  <p>Bottom Round of Beef<br/>
  Chicken Breast 6oz<br/>
  Chicken Breast 8oz<br/>
  Chicken Breast 8oz<br/>
  Chicken Breast 8oz<br/>
  Chicken Breast Random<br/>
  Chicken Legs<br/>
  Chicken Tenderloin<br/>
  Chicken Thighs<br/>
  Kosher Salt<br/></p>
  
  <p>I created a compound index on "ProductName,_id".</p>
  
  <p>I run this query: </p>
  
  <pre><code>db.ProductGuideItem.find( { ProductName: { $gt: "Chicken Breast 8oz" } } ).sort({ProductName:1,_id:1}).limit(3); 
  </code></pre>
  
  <p>Notice there are 3 "Chicken Breast 8oz" items. </p>
  
  <p>If I run that query I get...<br/>
  Chicken Breast Random<br/>
  Chicken Legs<br/>
  Chicken Tenderloin<br/> </p>
  
  <p>If I was paging and started from the top. The query would have missed 
  the other 2  "Chicken Breast 8oz". </p>
  
  <p>So if  each page can only have 3 items and I want to see page 2 then I should see..<br/>
  Chicken Breast 8oz<br/>
  Chicken Breast 8oz<br/>
  Chicken Breast Random.<br/></p>
  
  <p>But I'm not. It's going to the last Chicken Breast 8oz and starting from there instead.</p>
  
  <p>Is there a way around this?<br/>
  Also how would I do this if the list was sorted the opposite way?</p>