2

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 
Atul K
  • 53
  • 2
  • 9

2 Answers2

2

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.

manonthemat
  • 6,101
  • 1
  • 24
  • 49
  • You mean all files and folders from this location?, if so, it has many files and folders.. which one to delete? C:\Users\\Documents\Neo4j\default.graphdb – Atul K Feb 08 '16 at 11:03
  • That could be it (I'm not familiar with the windows environment with Neo4j). Does it have files like "messages.log", "neostore", "neostore.id", "neostore.propertystore.db" and maybe subdirectories like "index" and "schema"? If so, that's the one you want to delete to start fresh. You can also simply stop the server, move the directory somewhere else to make a backup and then start the server again. – manonthemat Feb 08 '16 at 19:59
2

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.
KinaneD
  • 306
  • 1
  • 2
  • 8