[英]Questions regarding importing csv into neo4j
I have three questions regarding importing csv: 关于导入csv,我有三个问题:
1) Yes you can use SKIP as well in LOAD CSV : 1)是的,您也可以在LOAD CSV中使用SKIP:
LOAD CSV WITH HEADERS FROM "file:///dummyfile.csv" AS row
WITH row
SKIP 1
MERGE (n:Node {id: row[0]})
2) If the csv column value is NULL, then the corresponding property value will be null as well. 2)如果csv列值为NULL,则相应的属性值也将为null。 If it is empty, then the property will not be created
如果为空,则不会创建该属性
Assume the following CSV : 假设以下CSV:
id,title,desc
1,title 1,desc1
2,,desc 2
And the following LOAD CSV : 以及以下LOAD CSV:
LOAD CSV WITH HEADERS FROM "https://gist.githubusercontent.com/ikwattro/ed85bfc98c9298924c154ecf3e0ab2aa/raw/54a9303c365a7698c87728d458f8de703a9c22e1/load.csv" AS row
CREATE (n:Post {id: row['id'], title: row['title'], description: row['desc']})
This would create the following : 这将创建以下内容:
╒══════════════════════════════════════════════════╕
│"n" │
╞══════════════════════════════════════════════════╡
│{"description":"desc1","id":"1","title":"title 1"}│
├──────────────────────────────────────────────────┤
│{"description":"desc 2","id":"2"} │
└──────────────────────────────────────────────────┘
3) Yes, Neo4j being schemaless you don't need to have the same number of properties on nodes with the same label 3)是的,Neo4j是无模式的,在具有相同标签的节点上不需要具有相同数量的属性
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.