title: How to insert result of count query into docs returned from a find query?
body: <p>I have a basic find query that gets all user "groups" from the database. For example: <code>db.groups.find({})</code>. The result of this looks like this:</p>
  
  <pre><code>[{
    name:  'Finance',
    desc:  'The finance team',
    color: '#FF0000'
  },
  {
    name:  'Sales',
    desc:  'The sales team',
    color: '#008000'
  }]
  </code></pre>
  
  <p>Now I also have a users collection, which references one or more of these groups per user. For example:</p>
  
  <p><code>db.users.find({})</code></p>
  
  <pre><code>[{
    firstname:  'Joe',
    lastname: 'Smith'
    groups:  ['Finance'],
  },
  {
    firstname: 'Jane',
    lastname: 'Smith',
    groups: ['Finance', 'Sales']
  }]
  </code></pre>
  
  <p>Essentially, I'm trying to build a query that returns the following results:</p>
  
  <pre><code>[{
    name:  'Finance',
    desc:  'The finance team',
    color: '#FF0000',
    user_count: 2
  },
  {
    name:  'Sales',
    desc:  'The sales team',
    color: '#008000',
    user_count: 1
  }]
  </code></pre>
  
  <p>I'm unsure of how to go about this, I'm thinking along the lines of aggregates, or possibly something in the projection?</p>
  
  <p><code>db.groups.find({}, {name: 1, desc: 1, color: 1, user_count: ???})</code></p>