title: How to get lastest N records of each group in mongodb?
body: <p>I have a couple of entries for each cities. How to get lastest 3 entries of each city? Like:</p>
  
  <p>City1<br>
  record 1<br>
  record 2<br>
  record 3
  <br><br>
  City2<br>
  record 1<br>
  record 2<br>
  record 3
  <br><br>
  City3<br>
  record 1<br>
  record 2<br>
  record 3<br></p>
  
  <p>The schema:</p>
  
  <pre><code>var schema = mongoose.Schema({
    city: {type: String},
    title: {type: String},
    created: {type: Number, default: Math.floor(new Date() / 1000)}
  })
  </code></pre>
  
  <p>The code I've tried:</p>
  
  <pre><code>Collection
  .find('location $in ' + cities)
  .aggregate({$group: {location: "$location"}})
  .sort('created: 1')
  .limit(3).exec(function(err, docs) { res.render('index', { hash: docs }); });
  </code></pre>
  
  <p>So, how to perform a query where I should have as result: 3 most recent titles of each city </p>