Neo4j - How to delete unused property keys from br

2019-01-22 14:25发布

问题:

I've deleted all my nodes and relationships (Delete all nodes and relationships in neo4j 1.8), but I see that in Neo4j Browser the "property keys" that existed before the deletion remain.

See the picture below:

How can I make all the "Property Keys" go away too, so I can end up with a fresh new database? I understand this orphan property keys do not pose a problem themselves, but they clutter the browser experience and will start confusing with newer properties.

Thanks!

回答1:

You should be able to clear everything out by:

  • stopping your Neo4j database
  • deleting everything matching data/graph.db/* (look inside the graph.db folder)
  • starting up again.


回答2:

What version of Neo4j are you using? Prior to to version 2.3 there is a file named keystore in the data/ directory that was used to populate this in the browser. Deleting this file will clear out the Labels, Relationship Types, and Property Keys listed in the browser.

Looks like this has changed now with Neo4j 2.3 so if you are using the latest version I don't think you'll have this file.



回答3:

In the manual you can see that there is currently no way to disentangle which property keys are currently used without traversing the graph.

http://neo4j.com/docs/stable/rest-api-property-values.html#_property_keys

Which is a bummer because I'd like to do the same thing. TBC.



回答4:

I got rid of the properties by open a new DB.|(I didn't want to delete my old folder ) Create a new folder beside the default folder stop the server choose the new folder and start again a new DB with new PW



回答5:

I have Neo4j Community Edition 3.2. To get rid of the property keys (and get rid of the entire DB), I completely uninstalled Neo4j, deleted the Neo4j folder in C:\Program Files and then reinstalled the package again so that I had a fresh DB to work with. Not ideal to delete everything but it worked for me.



标签: neo4j nosql