REMOVE
MATCH (n:Person) WHERE n.name = 'Alice' REMOVE n.temporary_flagRemove properties or labels from a matched node or relationship. Unlike DELETE, REMOVE only drops properties or labels — the node itself stays.
Syntax#
MATCH (variable) WHERE predicate
REMOVE <removal>[, <removal>]*Each <removal> is one of:
| Form | Effect |
|---|---|
n.key | Remove a single property |
n:Label | Remove a single label |
n:Label1:Label2 | Remove multiple labels |
Examples#
Multiple properties in one clause#
MATCH (r:Robot {id: 'r1'})
REMOVE r.legacy_id, r.deprecated_fieldRemove a label#
MATCH (n:Person {id: 'p1'}) REMOVE n:VerifiedProperty removal as null-assignment#
SET n.key = null is equivalent to REMOVE n.key. Use whichever fits the surrounding clause better.
See Also#
Try it
Open ↗⌘↵ to run
Loading engine…