title: Mongoose using subquery in aggregation to sum data
body: <p>I am new in mongoose. I have model like this. </p>
  
  <pre><code>var ForumSchema = new mongoose.Schema({
  User_id             : {type : Schema.Types.ObjectId, ref : 'User'},
  Title               : {type : String},
  Content             : {type : String},
  Tags                : [{type : String}],
  isPublic            : {type : Boolean, default : false},
  Vote                : [{
      User_id         : {type : Schema.Types.ObjectId, ref : 'User'},
      Kind            : {type : Boolean}
  }],
  Rate                : [{
      User_id         : {type : Schema.Types.ObjectId, ref : 'User'},
      Count           : {type : Number}
  }],
  Comment             : [{
      User_id         : {type : Schema.Types.ObjectId, ref : 'User'},
      Content         : String,
      Created_at      : {type : Date, required : true, default : Date.now}
  }],
  Created_at          : {type : Date, required : true, default : Date.now},
  Updated_at          : {type : Date}
  </code></pre>
  
  <p>});</p>
  
  <p>I want to get Forum data with sum of <code>Vote</code> that value is true. Like this json.</p>
  
  <pre><code>{
  [
      _id         : &lt;Some object id&gt;,
      User_id     : &lt;Some object id from User Model&gt;,
      Title       : &lt;Title&gt;,
      Content     : &lt;Content&gt;,
      Tags        : [Some array],
      isPublic    : true,
      UpVote      : 23,
      ....
      ....
      ....
  ]
  </code></pre>
  
  <p>}</p>
  
  <p>In mysql I can do this by using subquery. How can I do it in mongoose?</p>