title: Can not get $sum in aggregate function in MongoDB
body: <p>Here's my data format :</p>
  
  <pre><code>"request" : {
      "_id" : 1003,
      "user" : {
          "username" : "",
          "password" : "",
          "_id" : 1111,
          "gender" : "male",
         },
      "request" : {
          "merchantid" : "TA456",
          "txnAmount" : 18000,
          "fee" :0,
          "IssuerID" : "18801111",
          "bankID" : "888888",
      }
  
  },
   "confirmation" : true
  </code></pre>
  
  <p>}`</p>
  
  <p>I can not get the sum of 'request.request.txnAmount' group by 'request.user._id'.</p>
  
  <p>Here's my query:</p>
  
  <pre><code>db.getCollection('megabank_response').aggregate(
  [ {        $group : {
             _id : "request.user._id",
             totalPrice: { $sum: "request.request.txnAmount"},
             count: { $sum: 1 }
          }
        }
     ])
  </code></pre>
  
  <p>And get the result :</p>
  
  <pre><code>{
      "_id" : "request.user._id",
      "total Price" : 0,
      "count" : 4.0
  }
  </code></pre>
  
  <p>Can anyone help me why my query cannot calculate the sum?</p>