title: Mongodb Sum query returns nothing
body: <p>I have this example of activities row collection</p>
  <pre><code>{
    &quot;_id&quot; : ObjectId(&quot;5ec90b5258a37c002509b27d&quot;), 
    &quot;user_hash&quot; : &quot;asdsc4be9fe7xxx&quot;, 
    &quot;type&quot; : &quot;Expense&quot;, 
    &quot;name&quot; : &quot;Lorem&quot;, 
    &quot;amount&quot; : 10000, 
    &quot;date_created&quot; : 1590233938 
  }
  </code></pre>
  <p>I'd like to collect the sum amount of the activity with this aggregate code</p>
  <pre><code>db.activities.aggregate(
    [
      {
        $group: 
          {
            _id: &quot;$id&quot;, 
            total: { $sum: &quot;$amount&quot; } 
          } 
      }, 
      { 
        $match: { type: &quot;Expense&quot;, &quot;user_hash&quot;: &quot;asdsc4be9fe7xxx&quot; } 
      } 
    ] 
  )
  </code></pre>
  <p>Expected result : {_id: null, total: xxxxx }</p>
  <p>Actual result:</p>
  <p>Any solution for this? Thank you in Advance</p>