I want to create a relationship with the same node
LOAD CSV WITH HEADERS FROM "file:///transactions.csv" AS line
WITH line
MERGE (c:Customer {loginId: line.`login_ID`, name: line.Customer_Name, age: line.Customer_Age, occupation: line.Customer_Occupation})
The above code is used to create a Customer node and then I write the code below to define a relationship called FRIEND on this same node.
LOAD CSV WITH HEADERS FROM "file:///transactions.csv" AS line
WITH line
MERGE (c:Customer {name:line.Customer_Name})
ON CREATE SET c.name = line.Customer
RETURN line
LOAD CSV WITH HEADERS FROM "file:///transactions.csv" AS line
WITH line
MATCH (c1:Customer {name:line.'Ben Thompson'}), (c2.Customer {name:line. 'Ricky Marty'})
MERGE (c1)-[:FRIEND]->(c2)
But when I run this code it doesn't work, what am I doing wrong here? The values 'Ben Thompson' and 'Ricky Marty' are present in the csv file and they appear as Ben, Thompson, and Ricky, Marty in the graph when I run
MATCH(n) RETURN(n)
since that's how they appear in the csv file being the first_name and last_name of a customer. Any help is appreciated. Thank you for your time in advance.