According to https://www.arangodb.com/2014/07/13/arangodb-2-2-0-released it shall be possible to use statements like this:
LET sum = 0
FOR v IN values
SORT v.year
LET sum = sum + v.value
RETURN { year: v.year, value: v.value, sum: sum }
I currently use version 2.4 but am not able to use it, e.g. in such a statement:
LET sum = 0
FOR i in memoryColl
LET sum = sum + 1
// sum = sum + 1
RETURN { "i": i, "sum": sum }
I got the error [1511] variable 'sum' is assigned multiple times (while parsing)
Can somebody tell me if such a statemtn should in principle work, and how exactly?