Map params with Merge or build a Batch operation via the client?

后端 未结 1 1763
谎友^
谎友^ 2021-01-28 23:45

Is there any way to map params passed in using Merge?

Ideally, this is what I want to do:

Merge node (create if not exists, or update the entire node properties

相关标签:
1条回答
  • 2021-01-29 00:49
    FOREACH (n in {set} | MERGE (c:Label {Id : n.Id}) SET c = n)
    

    http://docs.neo4j.org/chunked/stable/query-foreach.html

    Update: The other option, coming soon, is that you will be able to write something like this in Cypher:

    LOAD CSV WITH HEADERS FROM 'file://c:/temp/input.csv' AS n
    MERGE (c:Label { Id : n.Id })
    SET c = n
    

    https://github.com/davidegrohmann/neo4j/blob/2.1-fix-resource-failure-load-csv/community/cypher/cypher/src/test/scala/org/neo4j/cypher/LoadCsvAcceptanceTest.scala

    0 讨论(0)
提交回复
热议问题