Doctrine\MongoDB\Aggregation\Stage\Group::sum PHP Method

sum() public method

Calculates and returns the sum of all the numeric values that result from applying a specified expression to each document in a group of documents that share the same group by key. Ignores nun-numeric values.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/sum/
See also: Expr::sum
public sum ( mixed | Expr $expression ) : Operator
$expression mixed | Doctrine\MongoDB\Aggregation\Expr
return Operator
    public function sum($expression)
    {
        $this->expr->sum($expression);
        return $this;
    }