+1 vote
in Neo4j by
How can you delete databases in Neo4J?

1 Answer

0 votes
by

Delete commands in Neo4J:

Delete a single node:

MATCH (n:Person { name: 'UNKNOWN' })  

DELETE n  

Delete all nodes and relationships:

MATCH (n)  

DETACH DELETE n  

Delete a node with its relationship:

MATCH (n { name: 'Andres' })  

DETACH DELETE n  

Delete relationships only:

MATCH (n { name: 'Andres' })-[r:KNOWS]->()  

DELETE r  

Related questions

0 votes
+1 vote
asked Jan 27, 2023 in Neo4j by sharadyadav1986
+1 vote
+1 vote
+1 vote
asked Jan 25, 2023 in Neo4j by sharadyadav1986
...