REMOVE

MATCH (n:Person) WHERE n.name = 'Alice' REMOVE n.temporary_flag

Remove 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:

FormEffect
n.keyRemove a single property
n:LabelRemove a single label
n:Label1:Label2Remove multiple labels

Examples#

Multiple properties in one clause#

MATCH (r:Robot {id: 'r1'})
REMOVE r.legacy_id, r.deprecated_field

Remove a label#

MATCH (n:Person {id: 'p1'}) REMOVE n:Verified

Property removal as null-assignment#

SET n.key = null is equivalent to REMOVE n.key. Use whichever fits the surrounding clause better.

See Also#

  • SET — set properties or labels
  • DELETE — remove entire nodes
Try it
Open ↗
Loading engine…