Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Neo4j - How to delete unused property keys from browser?

Tags:

nosql

neo4j

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:

enter image description here

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!

like image 798
jotadepicas Avatar asked Nov 29 '15 12:11

jotadepicas


People also ask

How do I remove a property from Neo4j?

Remove all properties REMOVE cannot be used to remove all existing properties from a node or relationship. Instead, using SET with = and an empty map as the right operand will clear all properties from the node or relationship.

How do I delete everything on Neo4j?

Deleting Nodes and Relationships Deleting all nodes and relationships in a Neo4j database is very simple. Here is an example that does just that: MATCH (n) DETACH DELETE n; The DETACH keyword specifies to remove or “detach” all relationships from a particular node before deletion.

What are property keys in Neo4j?

propkeys — Property keys Property keys in the Neo4j database, returned as a cell array of character vectors. Each character vector denotes a property key.


2 Answers

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.
like image 81
Brian Underwood Avatar answered Sep 22 '22 14:09

Brian Underwood


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.

like image 38
William Lyon Avatar answered Sep 21 '22 14:09

William Lyon