Skip to main content
The DELETE clause is used to remove nodes and relationships from the graph.

Important Behavior

⚠️ Note: Deleting a node automatically deletes all of its incoming and outgoing relationships. You cannot have orphaned relationships in the graph.

Deleting Nodes

To delete a node and all of its relationships:

Deleting Relationships

To delete specific relationships:
This query deletes all outgoing FRIENDS relationships from the node with name ‘Jim’, while keeping the nodes intact.

Common Patterns

Delete all nodes and relationships in a graph

The DETACH DELETE automatically removes all relationships before deleting the node.

Conditional deletion

Deletes all Person nodes where age is less than 18.

Frequently Asked Questions

Deleting a node automatically deletes all of its incoming and outgoing relationships. FalkorDB does not allow orphaned relationships in the graph.
In FalkorDB, DELETE actually implements DETACH DELETE behavior — relationships are automatically removed when their endpoint nodes are deleted. Both keywords work the same way.
Use MATCH (n) DETACH DELETE n to remove all nodes and their relationships. Alternatively, use the GRAPH.DELETE command to remove the entire graph key.
Yes. Match the relationship with an alias and delete only it: MATCH (a)-[r:KNOWS]->(b) DELETE r. The nodes remain intact.