title: Mongodb Explain for Aggregation framework
body: <p>Is there an explain function for the Aggregation framework in MongoDB? I can't see it in the documentation.</p>
  
  <p>If not is there some other way to check, how a query performs within the aggregation framework?</p>
  
  <p>I know with find you just do </p>
  
  <pre class="lang-js prettyprint-override"><code>db.collection.find().explain()
  </code></pre>
  
  <p>But with the aggregation framework I get an error</p>
  
  <pre class="lang-js prettyprint-override"><code>db.collection.aggregate(
      { $project : { "Tags._id" : 1 }},
      { $unwind : "$Tags" },
      { $match: {$or: [{"Tags._id":"tag1"},{"Tags._id":"tag2"}]}},
      { 
          $group: 
          { 
              _id : { id: "$_id"},
              "count": { $sum:1 } 
          }
      },
      { $sort: {"count":-1}}
  ).explain()
  </code></pre>