title: How can I retrieve document with max value in one of its fields Mongo Db
body: <p>Can anyone tell me how How can I retrieve document with max value in one of its fields Mongo Db.Using mongoTemplate Class</p>
  
  <p>here is an Example</p>
  
  <pre><code>{
      "_id" : "post 1",
      "author" : "Bob",
      "content" : "...",
      "page_views" : 5
  }
  {
      "_id" : "post 2",
      "author" : "Bob",
      "content" : "...",
      "page_views" : 9
  }
  {
      "_id" : "post 3",
      "author" : "Bob",
      "content" : "...",
      "page_views" : 8
  }
  </code></pre>
  
  <p>so i want following result</p>
  
  <pre><code>{
      "_id" : "post 2",
      "author" : "Bob",
      "content" : "...",
      "page_views" : 9
  }
  </code></pre>
  
  <p>The record with max page_views</p>