title: The field "$name" must be an accumulator object
body: <p>I have a query and when I use a <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/group/" rel="noreferrer">$group</a> a error shows "the field "$name must be an accumulator object", if if remove the filed "$name" all works well and i have tried to use only "name" instead of "$name" and the error continues.</p>
  
  <pre><code>   User.aggregate([
      {
        $match: {
          "storeKey": req.body.store        
        }
    },
    {
        $group: {
            "_id": "$_id",          
            "name": "$name",              
            "count": {
                "$sum": 1
            },
            "totalValue": {
                "$sum": "$value"
            }      
        }
    },
    {
      $sort: sort
    },
    {
       $skip: req.body.limit * req.body.page
    },
    {
       $limit: req.body.limit
    }
  ])...
  </code></pre>