openCypher icon indicating copy to clipboard operation
openCypher copied to clipboard

Allow indexed element access in CREATE|MERGE

Open fbiville opened this issue 9 years ago • 0 comments

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))))

fbiville avatar Mar 06 '17 10:03 fbiville