How to specify relationship type in CSV?

前端 未结 3 1718
野性不改
野性不改 2021-01-21 23:38

I have a CSV file with data like:

ID,Name,Role,Project
1,James,Owner,TST
2,Ed,Assistant,TST
3,Jack,Manager,TST

and want to create people whose

3条回答
  •  渐次进展
    2021-01-21 23:51

    Michael's answer stands, however, I've found that what I can do is specify an attribute to the relationship, like this:

    load csv from 'file:/.../x.csv' as line 
    match (p:Project {code: line[3]}) 
    create (i:Individual {name: line[1]})-[r:Role { type: line[2] }]->(p)
    

    and I can make Neo4j display the type attribute of the relationship instead of the label

提交回复
热议问题