我是Neo4j的新手。我有包含以下格式的数据的csv文件:
"from","to","amount","count"
"Lenin","George","10000","1"
"Mike","Suriya","4000","3"
"Mike","Norman","10000","1"
"George","Lenin","4000","1"
现在,我想用关系导入这个csv,这样我就可以获得像列宁和乔治那样的循环重定向图。我该怎么做?
答案 0 :(得分:0)
您可以使用
LOAD CSV WITH HEADERS FROM "file:///csv.csv" as row
MERGE (n:Person{name:row.from})
MERGE (m:Person{name:row.to})
MERGE (n)-[r:RELATIONSHIP]->(m)
ON CREATE SET r.amount = row.amount,
r.count = row.count