title: How can we implement Pagination for Mongodb Collection using mongoTemplate
body: <p>I'm a noob in mongoDb i need to implement Pagination for any specific Collection for instance say</p>
  
  <p>I have a Collection Foo and i have a Fucntion that returns all the records from the Foo collection</p>
  
  <pre><code>public List&lt;Foo&gt; getFoo(){
  
  }
  </code></pre>
  
  <p>But i need to fetch records from the Foo by implementing pagination how can i achieve this by using mongoTemplate Spring data mongodb?</p>