Atul K February 2016

Cleanup Database in neo4j

I wanted to delete all the nodes and relationships and its almost done. But In browser, it shows below: (See "Property keys" has 3 columns which I created as a part of nodes, which still remained and I want to delete that too)

    Node labels
      No labels in database 
    Relationship types
      No relationships in database 
    Property keys
      name stock type 

Answers


manonthemat February 2016

If you totally want to wipe out the complete database (including indices/constraints), then you can also just stop the server and delete the data/graph.db directory from the filesystem.


KinaneD February 2016

It is weird that some properties are left behind. If you are looking for deleting all nodes and relationships along with their properties:

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

If you would like to wipe the entire database and start from scratch:

  • Shutdown the server.
  • delete the configured directory rm -rf data/graph.db.
  • Start up the server again.

Post Status

Asked in February 2016
Viewed 1,360 times
Voted 7
Answered 2 times

Search




Leave an answer