Not following what's up with my cypher query. I have a set of nodes I've created successfully by loading CSV, and I have a second CSV that I'm trying to load relationships with. The nodes and their properties all load correctly, and the relationships all load correctly, but the relationship properties never load (no errors, just there's no props on any relationship when I'm done).
My CSV files are all headerless, I don't think that matters (but tell me if I'm mistaken). The relationship csv looks like this:
a,b,1
a,c,2
a,d,3
Where the first column is the identifier of the outbound side of the rel, the second is the identifier of the inbound side, and the third is the property I want on the relationship created.
I've tried a few variations:
first this:
USING PERIODIC COMMIT LOAD CSV FROM "file:///children.csv" AS row
MATCH (p1:DashboardPage {path:row[0]}), (p2:DashboardPage {path:row[1]})
CREATE (p1)-[:CHILD {order: row[3]}]->(p2);
then this:
USING PERIODIC COMMIT LOAD CSV FROM "file:///children.csv" AS row
MATCH (p1:DashboardPage {path:row[0]}), (p2:DashboardPage {path:row[1]})
MERGE (p1)-[c:CHILD]->(p2) ON MATCH SET c.order=toInt(row[3]);
A few other minor versions of the same. IN all cases everything was created in the DB as expected except the properties I was trying to assign to the relationships.
WITH HEADERS
and it worked as desired. Hopefully one of you fine folks will be able to tell me how to do it by column index in case it matters in the future. – Paul