MSAK24
MSAK24

Reputation: 53

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 

Upvotes: 2

Views: 3988

Answers (2)

KinaneD
KinaneD

Reputation: 346

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.

Upvotes: 2

manonthemat
manonthemat

Reputation: 6251

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.

Upvotes: 2

Related Questions