Hi,
I am relatively new to Neo4j and would like to know if the initial set properties of the relationships can be updated via another CSV source.
For example, I've created multiple nodes and relationships like:
FOREACH (IND3 IN (CASE WHEN a.temp = 1 THEN [a.temp] ELSE [] END) |
MERGE (ind3 :Indic3 {Indic3: IND3})
MERGE (a)-[e_ind3: example_text]->(ind3)
SET e_ind3.score = 10
SET e_ind3.temp_id = 3
)
And now I would like to routinely update those scores based on another given csv, rather than changing those scores manually, the format of the csv file is like:
Indic score
3 5
4 9
5 7
6 20
and I have tried the below way
MATCH (a: case)-[RULES]->()
WITH a, RULES
LOAD CSV WITH HEADERS FROM "file:///out_source.csv" AS row
MATCH (a)-[RULE {Indic: row.Indic}]->()
SET RULE.score= row.score
however, although it does change the properties of all relationships, they have all been changed to the last row, all ids become 6 and all scores become 20.
Looking forward to any suggestions. Thanks