cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a relationship, given neo4j Nodes and a relationship table?

leamonzea
Node Link

I've created Node from csv files, and I have a relationship table with headers [':START_ID (Actor)', ':EDN_ID (Musical)']. But I'm struggling to create a relationship. Not sure how I can specify the start node and end node using the relationship table. Thanks a lot. 

 

#py2neo 

2 REPLIES 2

glilienfield
Ninja
Ninja

Try something like the following:

match(n:Actor{id: START_ID})

match(m:Musical{id: EDN_ID})

merge(n)-[:RELATIONSHIP_TYPE]->(m)

Thanks for your reply. I've solved the problem by using matcher to get the nodes based on the property in relationship table.  Thanks a lot though!