FORCypher 25 onlyIntroduced in Neo4j 2026.04
The FOR clause makes it possible to transform any list back into individual rows.
The list can be a parameter that is passed in, a previously collected result, or any other list expression.
FOR is the GQL conformant synonym of UNWIND.
FOR is valid wherever UNWIND is valid and has the same semantics.
FOR and UNWIND differ only in syntax.
FOR variable IN expression
For comparison, the Cypher® UNWIND form is:
UNWIND expression AS variable
|
Neo4j does not guarantee the row order produced by |
Unwinding a list
We want to transform the literal list into rows named x and return them.
FOR x IN [1, 2, 3, null]
RETURN x, 'val' AS y
Each value of the original list — including null — is returned as an individual row.
The same outcome is shown here using the equivalent UNWIND form:
UNWIND [1, 2, 3, null] AS x
RETURN x, 'val' AS y
| x | y |
|---|---|
|
|
|
|
|
|
|
|
|
|
Further behavior
All cases described for UNWIND apply to FOR: empty lists, nested lists, expressions that are not lists, parameters, and combinations with WITH, RETURN, subqueries, and so on.