How to delete/create databases in Neo4j? How to delete/create databases in Neo4j? database database

How to delete/create databases in Neo4j?


even more simple command to delete all nodes and relationships:

MATCH (n)OPTIONAL MATCH (n)-[r]-()DELETE n,r


You can just remove the entire graph directory with rm -rf, because Neo4j is not storing anything outside that:

rm -rf data/*

Also, you can of course iterate through all nodes and delete their relationships and the nodes themselves, but that might be too costly just for testing ...


From Neo4j 2.3,

We can delete all nodes with relationships,

MATCH (n)DETACH DELETE n

Currently there is no any option to create multiple databases in Noe4j. You need to make multiple stores of Neo4j data. See reference.