title: mongodb sum query returning zero
body: <p>I have a collection <em>balance</em> with records  </p>
  
  <pre><code>{  
   "_id" : "uezyuLx4jjfvcqMXN",   
    "amount" : "10",   
  "createdBy" : "AGuT6zQtSojvozbbg"   
  }
  {  
   "_id" : "dCC8GrNdEjym3ryua",   
  "amount" : "10",  
  "createdBy" : "AGuT6zQtSojvozbbg"  
  }
  </code></pre>
  
  <p>I'm trying to calculate sum of amounts:</p>
  
  <pre><code>db.balance.aggregate([{$group:{_id:"$createdBy",total:{ $sum: "$amount"}}}])
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>{createdBy:AGuT6zQtSojvozbbg , total:20}
  </code></pre>
  
  <p>Actual output:</p>
  
  <pre><code>{ "_id" : "AGuT6zQtSojvozbbg", "total" : 0 }
  </code></pre>