title: How to get count before limit in the Mongo aggregation pipeline
body: <p>In the following query:</p>
  
  <pre><code>db.orders.aggregate([{ $match : { status: "A"}, { $limit: 5} }]);
  </code></pre>
  
  <p>How can I get the count of documents after the <code>$match</code> but before the <code>$limit</code> is applied?</p>
  
  <p>I still want to return an array of 5 documents. But if I use <code>$group</code> it seems that it would not preserve the array of documents. Can this be done in one call, or do I have to make two calls?</p>