title: Aggregate method in MongoDB Compass?
body: <p>as stated in the title i'm having some problems querying from MongoDB Compass using the aggregate methhod. I have a collection of documents in this form:</p>
  
  <pre><code>{"Array":[{"field":"val","field2":"val2"},{"field":"val","field2":"val2"},{"field":"val","field2":"val2"},{"field":"val","field2":"val2"},{"field":"val","field2":"val2"},...]}
  </code></pre>
  
  <p>using mongo shell or Studio 3T software I query it with aggregate method, follows an example:</p>
  
  <pre><code>db.collection.aggregate([
       { $match: {"Array.field": "val"}}, 
       { $unwind: "$Array"},
       { $match: {"Array.field": "val"}},
       { $group: {_id: null, count: {$sum:NumberInt(1)}, Array: {$push: "$Array"}}},
       { $project: {"N. Hits": "$count", Array:1}}
  ])
  </code></pre>
  
  <p>where I look for elements of Array who has field's value = "val" and count them. This works perfectly, but I don't know how to do the same in MongoDB Compass
  <a href="https://i.stack.imgur.com/Hua6W.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Hua6W.png" alt="enter image description here"></a></p>
  
  <p>in the query bar I have 'filter', 'project' and 'sort' and I can do usual queries, but i don't know how to use aggregate method.
  Thanks</p>