openCypher
openCypher copied to clipboard
Allow indexed element access in CREATE|MERGE
As perfectly explained here, the following query is not allowed in Cypher:
[...]
FOREACH(i in RANGE(0, length(seasons)-2) |
MERGE (seasons[i])-[:NEXT]->(seasons[i+1])))
Instead, the following workaround has to be applied:
[...]
FOREACH(i in RANGE(0, length(seasons)-2) |
FOREACH(si in [seasons[i]] |
FOREACH(si2 in [seasons[i+1]] |
MERGE (si)-[:NEXT]->(si2))))