SET, REMOVE, DELETE, DETACH DELETE

Mutating an existing graph — and the one keyword that prevents accidents.

0/2 done

Mutation verbs

The four mutation verbs

  • SET p.age = 33 — set / add a property.
  • SET p:Senior — add a label.
  • REMOVE p.age — drop a property; REMOVE p:Senior — drop a label.
  • DELETE r — delete a relationship.
  • DELETE n — delete a node (errors if it still has relationships!).
  • DETACH DELETE n — delete the node and its relationships in one shot.

Never MATCH (n) DETACH DELETE n without a label or filter in production.

Reading in progress · 0 of 2 activities done