title: How to use Distinct, Sort, limit with mongodb
body: <p>I have a document structure <code>{'text': 'here is text', 'count' : 13, 'somefield': value}</code></p>
  
  <p>Collection has some thousands of record, and <code>text</code> key value may be repeated many time, I want to find distinct text with highest count value,along with that whole document should be returned , I am able to sort them in descending order.</p>
  
  <p><code>distinct</code> returns unique value in a list.</p>
  
  <p>I want to use all three functions and document has to be returned, I am still learning and not covered mapreduce.</p>