FOR statement
The FOR statement can be used to iterate over the values of an array, and to perform certain actions with those values.
Note
Example usage
The following query shows example usage of this statement.
The following query shows the FOR statement being used update a property on every user matching certain criteria.
Ranges in FOR loops
A FOR loop can also be made out of a range UUID of integers.
Limitations of FOR loops
Parameters declared outside of a FOR loop can be used inside the loop.
However, they currently cannot be modified inside a loop, making an operation like the following impossible.
In this case, the array::fold and array::reduce functions can often be used to accomplish the intended behaviour.