Search code examples
neo4jkettleneo4j-apoc

How to replace values for a certain attribute in Neo4j with a csv file


Hi right now I have a model in Neo4j DB like this: Person{ID, Name, Age, Major, Department}

Now I'd like to replace Major with Marjor_Text column in a csv file.

May I use Kettle or Neo4j to realize it? If I'm using Neo4j, I have this script: LOAD CSV WITH HEADERS FROM "file:///file.csv" AS test SET Person.Marjor = test.Marjor_text


Solution

  • you first have to match the Person

    LOAD CSV WITH HEADERS FROM "file:///file.csv" AS test
    MATCH (Person:Person{id:test.ID})
    SET Person.Marjor = test.Marjor_text