title: Mongo DB - fastest way to retrieve 5 Million records from a collection
body: <p>I am using MongoDB in our project and I'm currently learning how things work</p>
  
  <p>I have created a collection with 5 million records. When i fire the query <code>db.ProductDetails.find()</code> on the console it takes too much time to display all the data. </p>
  
  <p>Also when i use the following code in C#</p>
  
  <pre><code>var Products = db.GetCollection("ProductDetails").FindAll().Documents.ToList();
  </code></pre>
  
  <p>the system throws <code>OutOfMemoryException</code> after some time..</p>
  
  <p>Is there any other faster or more optimized way to achieve this ? </p>