Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-23-2021 12:46 PM
Answer given by the tutorial.
LOAD CSV WITH HEADERS
FROM 'http://data.neo4j.com/v4.0-intro-neo4j/actors.csv'
AS line
MERGE (actor:Person {name: line.name})
ON CREATE SET actor.born = toInteger(trim(line.birthYear)), actor.actorId = line.id
ON MATCH SET actor.actorId = line.id
My answer:
LOAD CSV WITH HEADERS
FROM 'http://data.neo4j.com/v4.0-intro-neo4j/actors.csv'
AS line
MERGE (p:Person{actorId:toInteger((line.id)})
ON CREATE SET
p.name = line.name,
p.born = toInteger(trim(line.birthYear))
Why is this part needed?
actor.actorId = line.id
ON MATCH SET actor.actorId = line.id
Why do a second MATCH SET for actorId?
Solved! Go to Solution.
04-23-2021 01:38 PM
This is a side-effect of how "clean" the data is that you are importing.
The data may have repeated actor lines. If a duplicate is found that means that that actor has already been loaded and we will use the latest id encountered in the CSV file.
Elaine
04-23-2021 01:38 PM
This is a side-effect of how "clean" the data is that you are importing.
The data may have repeated actor lines. If a duplicate is found that means that that actor has already been loaded and we will use the latest id encountered in the CSV file.
Elaine
All the sessions of the conference are now available online