The UNWIND clause expands a Cypher list into separate rows, producing one row for each element. It assigns each element to a reference variable with AS, much like iterating through a list in a for loop. section 7.1 section 7.7
Use UNWIND to turn list values into row-wise operations:
- Process each produced value independently in later clauses. section 7.1
Expanding a list into rows
UNWIND [1, 2, 3] AS i RETURN i The query returns three rows containing 1, 2, and 3. In a hashtag workflow, UNWIND hashtags AS tag_id produces one row per hashtag before matching or creating Tag nodes and HAS_TAG relationships.
