[Solved] Neo4j error: Cannot merge the following node because of null property value for ‘casualty’

Execute the following command in neo4j:

LOAD CSV WITH HEADERS  FROM "file:///accident.csv" AS line
MERGE (p:accident{id:line.id,name:line.code,casualty:line.casualty})

 

Report an error:

Cannot merge the following node because of null property value for 'casualty': (:accident {casualty: null}) (Failure when processing file '/E:/Program/...../neo4j-community-4.4.8/import/accident.csv' on line 2.)

Cause: In the first time the entity is created and the casualty value in the file is empty.
Solution: Change merge to create

Source: Explanation of error “Cannot merge node using null property value for” – Knowledge Base

Read More: