How to delete/create databases in Neo4j?

rmv picture rmv · Dec 21, 2010 · Viewed 97k times · Source

Is it possible to create/delete different databases in the graph database Neo4j like in MySQL? Or, at least, how to delete all nodes and relationships of an existing graph to get a clean setup for tests, e.g., using shell commands similar to rmrel or rm?

Answer

Peter Neubauer picture Peter Neubauer · Dec 22, 2010

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 ...