How to delete/create databases in Neo4j

databaseneo4jnodesrelationshipssql-delete

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?

Best Answer

even more simple command to delete all nodes and relationships:

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