title: Mongoose sort the aggregated result
body: <p>I'm having a lot of difficulty in solving this mongodb (mongoose) problem. </p>
  
  <p>There is this schema 'Recommend' (username, roomId, ll and date) and its collection contains recommendation of user.</p>
  
  <p>I need to get a list of most recommended rooms (by roomId). Below is the schema and my tried solution with mongoose query.</p>
  
  <pre><code>var recommendSchema = mongoose.Schema({
      username: String,
      roomId: String,
      ll: { type: { type: String }, coordinates: [ ] },
      date: Date
  })
  recommendSchema.index({ ll: '2dsphere' });
  
  var Recommend = mongoose.model('Recommend', recommendSchema);
  Recommend.aggregate(
          {   
            $group: 
              { 
                  _id: '$roomId', 
                  recommendCount: { $sum: 1 } 
              }
          },
          function (err, res) {
              if (err) return handleError(err);
              var resultSet = res.sort({'recommendCount': 'desc'});
  
          }
      );
  </code></pre>