liveBook · Manning

Unwind clause

As explained in Graph Algorithms for Data Science

The UNWIND clause expands a Cypher list into separate rows, one for each list element.

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.

How Graph Algorithms for Data Science covers it

How deep it goes
Explains list-to-row behavior, AS binding, syntax, and a hashtag workflow without discussing execution internals.
Examples
Uses a numeric list example and extracts hashtags before creating Tag nodes and HAS_TAG relationships.
What it assumes
Assumes familiarity with Cypher lists and teaches the AS binding pattern through simple syntax and hashtag processing.
What you can do after
Apply it via Cypher to iterate through list elements and perform row-level graph operations.
How it connects
Connects UNWIND to Cypher lists, list comprehension, MERGE, nodes, and relationships.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Algorithms for Data Science. The section links point to the parts of the book it draws on.