sum.php
Table of Contents
Functions
- sum() : string
- Return the sum of the values in an array.
Functions
sum()
Return the sum of the values in an array.
sum(mixed $numArray) : string
This helper wraps the ArangoDB AQL function SUM(numArray) which calculates
the sum of all numeric values in the given array.
Example AQL usage:
SUM([1, 2, 3, 4]) // returns 10
SUM(doc.scores) // returns sum of all scores
SUM([5, 10, 15]) // returns 30
Parameters
- $numArray : mixed
-
Array expression containing numeric values to sum.
Tags
Return values
string —The formatted AQL expression.