Skip to main content
The SET clause is used to create or update properties on nodes and relationships.

Setting a Single Property

To set a property on a node:

Setting Multiple Properties

You can set multiple properties in a single SET clause by separating them with commas:

Setting Properties from a Map

You can set properties using a map. There are two operators with different behaviors:

Replace All Properties (=)

Replaces all existing properties with the map properties:
Result: The node will have only the properties age and name. Any other existing properties are removed.

Merge Properties (+=)

Updates only the specified properties while keeping other existing properties:
Result: The node’s age is updated to 33, but name and any other properties remain unchanged.

Copying Properties Between Entities

You can copy all properties from one entity to another:
After executing this query, the jim node will have exactly the same properties as the pam node (all of Jim’s original properties are replaced).

Removing Properties

To remove a property, set its value to NULL:
This removes the name property from the node entirely.

Frequently Asked Questions

The = operator replaces all existing properties with the map values. The += operator merges properties, updating only specified keys while keeping other existing properties intact.
Yes. Setting a property to NULL removes it: SET n.name = NULL. This is equivalent to using the REMOVE clause.
Yes. Use MATCH (a), (b) SET a = b to copy all of bs properties to a, replacing any existing properties on a.
Yes. Separate property assignments with commas: SET n.age = 33, n.name = 'Bob'. All assignments are applied in a single operation.