cypher - Neo4j: when merging does not overwrite node properties -
i want modify merge cypher query property field not overwritten.
to update node properties use following cypher query:
merge (n:person {name:"me"}) on match set n+={id:"2"} on create set n={name:"me", id="1"} return n
if call same query again on match set n+={id:"3"}
id updated.
how make query adds property if not existing not overwrite if present?
first, can use plain properties, no need {map}..
secondly, in case merge creates node, have property name:me on :
merge (n:person {name:'me'}) on match set n.id = 2 on create set n.id = 1 return n
Comments
Post a Comment