我必须使用以下CSV数据创建30多个节点作为属性
id,name,skill,cur_company,pre_company,college,location
1,"pavan","java","CGI","CSC","JNTU","HYDERABAD"
2,"ravi","java","TCS","CSC","SGPL","DELHI"
...
如何通过导入上述数据来创建节点。等,
u1:User {id:1,name:"pavan",skill:"java",cur_company:"CGI",prev_company:"CSC",location:"HYDERBAD"}
u2:User {id:2,name:"ravi",skill:"java",cur_company:"TCS",prev_company:"CSC",location:"DELHI"}
答案 0 :(得分:1)
Cypher中有一个专用的LOAD CSV命令:
load csv with headers from "file-url" as data
create (u:User {data}}
或
load csv with headers from "file-url" as data
create (u:User {id:data.id, name:data.name, ....}}
答案 1 :(得分:-1)
在应用上述命令之前,请在neo4j.conf文件中进行以下更改:
评论#dbms.security.allow_csv_import_from_file_urls=true
行
和
取消注释dbms.directories.import=import
行