title: MongoDB fetch documents with sort by count
body: <p>I have a document with sub-document which looks something like:</p>
  
  <pre><code>{ 
      "name" : "some name1" 
      "like" : [      
              {  "date" : ISODate("2012-11-30T19:00:00Z") },
              {  "date" : ISODate("2012-12-02T19:00:00Z") },     
              {  "date" : ISODate("2012-12-01T19:00:00Z") },
              {  "date" : ISODate("2012-12-03T19:00:00Z") } 
      ]       
  }
  </code></pre>
  
  <p>Is it possible to fetch documents "most liked" (average value for the last 7 days) and sort by the count? </p>