SET clause is used to update property values on existing nodes and edges. It is always used in combination with a MATCH clause that identifies the entities to update.
- Cypher
- Python SDK
Setting a single property
To update a property on a node or edge, useSET followed by a property assignment.age property of the matched node to 30. If the property does not already exist, it will be created.Setting multiple properties
Multiple properties can be updated in a singleSET clause by separating assignments with commas.Setting a property from an expression
The value assigned can be any expression, including arithmetic operations on existing properties.Setting a property from another variable
You can copy a property value from one matched entity to another.Updating edge properties
Edge properties can be updated using the same syntax.Updating a specific node by internal ID
Every node in TuringDB has an internal ID. You can target a specific node by comparing it directly to its ID in aWHERE clause. This is useful when you already know the exact node you want to update.Using SET with WHERE
SET can be combined with WHERE to update properties on nodes that match a condition.
