cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Create dynamically relationship with var from unwinded list

Hello everybody!

I've this cypher query and I want to create relationship between 2 nodes dynamically:

UNWIND $list as l
MATCH (node:Category { code: l.code }), (target:Category { code: l.codeTarget })
MERGE (node)-[:l.predicate]->(target)

Is it possible to do something like this?

Thank's you !

1 ACCEPTED SOLUTION

check out apoc.create.relationship from apoc library. In plain cypher you cannot have dynamic relationship types.

View solution in original post

2 REPLIES 2

check out apoc.create.relationship from apoc library. In plain cypher you cannot have dynamic relationship types.