15.20. Set

15.20.1. Set a property

Updating properties on nodes and relationships is done with the SET clause.

15.20.1. Set a property

To set a property on a node or relationship, use SET.

Query

START n = node(2)
SET n.surname = 'Taylor'
RETURN n

The newly changed node is returned by the query.

Result

n
1 row
Properties set: 1
2 ms

Node[2]{name:"Andres",age:36,surname:"Taylor"}


Try this query live. (1) {"age":34,"name":"Peter"} (2) {"age":36,"name":"Andres","surname":"Taylor"} (2)-[:KNOWS]->(1) {} start n = node(2) set n.surname = 'Taylor' return n