title: Select top N rows from each group
body: <p>I use mongodb for my blog platform, where users can create their own blogs. All entries from all blogs are in an entries collection. The document of an entry looks like:</p>
  
  <pre><code>{
    'blog_id':xxx,
    'timestamp':xxx,
    'title':xxx,
    'content':xxx
  }
  </code></pre>
  
  <p>As the question says, is there any way to select, say, last 3 entries for each blog?</p>