title: How can I get last 50 documents in mongoDB?
body: <p><strong>How can I get last 50 documents in mongoDB?</strong></p>
  
  <p>I have a collection which is made by </p>
  
  <pre><code>db.createCollection("collection",{capped:true, size:300000});
  </code></pre>
  
  <p>from this "collection"</p>
  
  <p>I would like to have last 50 documents instead of get first 50 documents.</p>
  
  <p>I know that I can get first 50 documents by using </p>
  
  <pre><code>db.collection.find().limit(50);
  </code></pre>
  
  <p>But how can I get last 50 documents?</p>
  
  <p><strong>Is this can be done simply with MongoDB API or should I implement this with programming?</strong></p>