Search code examples
neo4jcypherlanguage-features

`USING PERIODIC COMMIT` with `UNWIND` in cypher, neo4j


it would be cool if it was possible to make such a request:

USING PERIODIC COMMIT 5
UNWIND RANGE( 0, 50 ) as u
CREATE (n:New {number:u})
RETURN n

because there is a cool use case for Cypher query language in json parsing...


Solution

  • Unfortunately that's not possible. PERIODIC COMMIT is tied to the LOAD CSV command now.

    But for your example you don't need it.

    And parsing JSON in Cypher is easy, you just pass in the outermost JSON object as parameter and then deconstruct it in cypher with UNWIND, WITH, FOREACH etc.