title: mongodb aggregation: Chaining aggregation
body: <p>Not sure if this can be done, but I gotta ask:</p>
  
  <p>Can I send in multiple aggregation in one request?  In other words, rather than doing the following:</p>
  
  <pre><code>one_results = db.results.aggregate([ 
      { $project: { _id: 0, key: "$Field1" }}, 
      { $group: { '_id': '$key', count: { $sum: 1 }}} ])
  
  two_results = db.results.aggregate([ 
      { $project: { _id: 0, key: "$Field2" }}, 
      { $group: { '_id': '$key', count: { $sum: 1 }}} ])
  </code></pre>
  
  <p>I want to do something like this:</p>
  
  <pre><code>[one_results, two_results] = db.results.aggregate(
    [ 
      { $project: { _id: 0, key: "$Field1" }}, 
      { $group: { '_id': '$key', count: { $sum: 1 }}} 
    ],
    [ 
      { $project: { _id: 0, key: "$Field1" }}, 
      { $group: { '_id': '$key', count: { $sum: 1 }}} 
    ])
  </code></pre>
  
  <p>I know it's a stretch, but I gotta ask...</p>
  
  <p>Thanks</p>