title: Mongodb aggregate (count) on multiple fields simultaneously
body: <p>I've got documents that look like this:</p>
  
  <pre><code>{
      "_id" : "someuniqueeventid",
      "event" : "event_type_1",
      "date" : ISODate("2014-01-14T00:00:00Z"),
  }
  </code></pre>
  
  <p>I want to group by "<code>event</code>" and count how many of each event type occured in each day of the week. Basically, I want to get something like:</p>
  
  <pre><code>{
      "_id": "event_type_1",
      "1": "number of event_type_1 for Monday",
      "2": "number of event_type_1 for Tuesday",
      ...
  },
  {
      "_id": "event_type_2",
      ...
  }
  </code></pre>
  
  <p>Unfortunately, I'm stuck at:</p>
  
  <pre><code>db.data.aggregate([ {$project: {date_of_week: {$dayOfWeek: "$date"}, event: "$event"}}, 
                      {$group: {_id: "$event", .... } ])
  </code></pre>
  
  <p>Any ideas?</p>