title: How do i sort by adding the values in mongoose using aggregation?
body: <p>I have two models, post and vote.</p>
  <p>Post schema</p>
  <pre><code>title:{
      type: String,
      required: true,
  },
  description:{
      type: String,
      required: true,
  },
  votes: [
      {
          type: Schema.Types.ObjectId,
          ref: 'Vote'
      }
  ],
  </code></pre>
  <p>Vote Schema</p>
  <pre><code>const voteSchema = new Schema({
      post:{
          type: Schema.Types.ObjectId,
          ref: 'Post',
      },
      value:{
          type: Number,
          required: true,
      },
  });
  </code></pre>
  <p>I am trying to sort post by the most value of votes grouped.</p>
  <p>Maybe something like this?</p>
  <pre><code>var posts = Post.aggregate([{$sort: { $group: votes: {$sum: value} }}
  </code></pre>
  <p>Any help would be appreciated.</p>
  <p>Thanks!</p>