Hi everyone,
I try to load csv file into the neo4j.
My Query is:
:auto USING PERIODIC COMMIT 5000
LOAD CSV WITH HEADERS FROM "file:///C:/mesh_network.csv" AS line
FIELDTERMINATOR ';'
Merge(n:Mesh {name:line.mesh,frequency:toInteger(line.frequency1)})
Merge(m:Mesh {name:line.mesh,frequency:toInteger(line.frequency2)})
Merge (n)-[:SEEN {weight:toInteger(line.weight)}]-(m)
Before loading data I set node should be unique based on node name.
Thank you koji for your answer. Before loading the data i created constraint as you mentioned.
Without constraint it works. However i rellay want to single node for each mesh. That is why i created unique constraint. Otherwise the graph becames disconnected likte this.
Hi , i checked number of unique mesh for both mesh1 and mesh2. Then i realized that the number of mesh2 more than number of mesh1. Then i picked up mesh2 as a first node and mesh1 for second node then it worked even wiht unique constraint.
Thank you again