title: Mongoose group by field and grouped result should be stored as groupname: object
body: <p>For the following Schema (pseudo code).</p>
  
  <pre><code>new mongoose.Schema({
        name: {type: String, unique: true},
        foo: {type: Number},
        bar: {type: Number, default: null},
  }
  </code></pre>
  
  <p>Normal Result would be .find():</p>
  
  <pre><code>[{
      _id: x
      name: 'Name1'
      foo: 1
      bar: 222
  }, {
      _id: y
      name: 'Name2'
      foo: 1
      bar: 333
  }, {
      _id: z
      name: 'Name3'
      foo: 2
      bar: 444
  }];
  </code></pre>
  
  <p>I want return results grouped by foo and the the key should be the variable/number of foo:</p>
  
  <pre><code>[{
      '1': [{
          name: 'Name1'
          bar: 222
      }, {
          name: 'Name2'
          bar: 333
      }],
      '2': [{
          name: 'Name3'
          bar: 444
      }]
  }]
  </code></pre>
  
  <p>I was trying that with aggregate, but i were never able to replace _id with the the 'Number of Foo'. </p>
  
  <p>Is this even possible with mongoose? Or do i need to edit the object within a Nodejs function?</p>