GRAPH.DELETE

Completely removes a graph and all of its entities (nodes and relationships).

Syntax

GRAPH.DELETE graph_name

Arguments:

  • graph_name - Name of the graph to delete

Returns: String indicating if the operation succeeded or failed.

Examples


graph.delete()

await graph.delete();

graph.delete()?;

graph.delete();

GRAPH.DELETE us_government

Deleting Individual Nodes

Note: To delete specific nodes or relationships (not the entire graph), use the Cypher DELETE clause with a MATCH query:


graph.query("MATCH (x:Y {propname: propvalue}) DELETE x")

await graph.query("MATCH (x:Y {propname: propvalue}) DELETE x");

graph.query("MATCH (x:Y {propname: propvalue}) DELETE x")?;

graph.query("MATCH (x:Y {propname: propvalue}) DELETE x");

GRAPH.QUERY DEMO_GRAPH "MATCH (x:Y {propname: propvalue}) DELETE x"

⚠️ Warning: When you delete a node using the Cypher DELETE clause, all of the node’s incoming and outgoing relationships are also automatically removed.