Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-09-2020 01:48 PM
How to add properties to relationship while load data using LOAD CSV option?
Solved! Go to Solution.
09-09-2020 04:15 PM
If you use the test.csv from apoc.load.csv docs:
name,age,beverage
Selma,9,Soda
Rana,12,Tea;Milk
Selina,19,Cola
CALL apoc.load.csv('test.csv')
YIELD lineNo, map
MERGE (p:Person {name: map.name})
MERGE (b:Beverage {name: map.beverage})
MERGE (p)<-[:DRANK_BY {age: map.age}]-(b)
09-09-2020 04:13 PM
Hi, you should have a csv with relationships and properties.
https://neo4j.com/docs/getting-started/current/cypher-intro/load-csv/
09-12-2020 05:07 AM
Thanks iggomez for the source..
09-09-2020 04:15 PM
If you use the test.csv from apoc.load.csv docs:
name,age,beverage
Selma,9,Soda
Rana,12,Tea;Milk
Selina,19,Cola
CALL apoc.load.csv('test.csv')
YIELD lineNo, map
MERGE (p:Person {name: map.name})
MERGE (b:Beverage {name: map.beverage})
MERGE (p)<-[:DRANK_BY {age: map.age}]-(b)
09-12-2020 05:07 AM
Thanks tony.. it helped
All the sessions of the conference are now available online