apoc.coll.sumLongsFunctionDeprecated in Cypher 25
| This function is deprecated.
Use Cypher’s  | 
| Syntax | 
 | ||
| Description | Returns the sum of all the  | ||
| Arguments | Name | Type | Description | 
| 
 | 
 | The list of numbers to create a sum from after each is cast to a java Long value. | |
| Returns | 
 | ||
Usage examples
The following examples compute the sum of numeric values in a list, casting them to Long (Cypher integer) values in the process, using both APOC and Cypher:
apoc.coll.sumLongs
WITH [1.5,2.5,3.6,4.3,5.2] AS list
RETURN apoc.coll.sumLongs(list) AS outputUsing Cypher’s reduce() and toIntegerList()
WITH [1.5,2.5,3.6,4.3,5.2] AS list
RETURN reduce(sum = 0, x IN toIntegerList(list) | sum + x) AS output| output | 
|---|
| 15 |