13
votes

Is there any update query in cypher using which we can update the property of any node or relationship ?
For e.g. I have following node and relationship:
NodeA-[r:relatedTo]-NodeB
where relatedTo is a relationship having properties like active or inactive

How can I change this property using cypher query ?

1

1 Answers

23
votes

using SET keyword in cypher query, see http://docs.neo4j.org/chunked/snapshot/query-set.html . (Since I have not came across any update query in cypher like in other RDBMS)

NodeA-[r:relatedTo]-NodeB
try to set value by : SET r.<your property name>="<desired value>"; before returning any value from start n=node(...)... return n; query.