I have three questions regarding importing csv:
1) Yes you can use SKIP as well in LOAD CSV :
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. If it is empty, then the property will not be created
Assume the following CSV :
id,title,desc
1,title 1,desc1
2,,desc 2
And the following 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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.