3

I'm looking how to remove property keys from Neo4j 3.0. I tried :

MATCH (n)
DETACH DELETE n

But it doesn't delete property keys. I tried to remove data folder from my graphdb and restart the server but still have the same thing. Thank you

MAYA
  • 1,243
  • 1
  • 12
  • 20

2 Answers2

3

You can't really remove the properties from the left pane of the neo4j browser (see Neo4j - How to delete unused property keys from browser?).

To remove a property from nodes do:

MATCH (n:Node)
REMOVE n.my_key

Your query will delete the node itself.

Community
  • 1
  • 1
Martin Preusse
  • 9,151
  • 12
  • 48
  • 80
  • I tested but no change because I deleted the nodes using this: MATCH (n) DETACH DELETE n But still have the property keys – MAYA Aug 30 '16 at 13:23
  • Without a node you don't **have** a property key. Maybe it's shown on the left side of the web interface, but you don't have any data. – Martin Preusse Aug 30 '16 at 13:32
  • Exactly, it's shown on the left side of my interface and now I have a large list. How can I remove it without nodes? – MAYA Aug 30 '16 at 13:46
  • Not really possible except by deleting the database files: http://stackoverflow.com/questions/33982639/neo4j-how-to-delete-unused-property-keys-from-browser – Martin Preusse Aug 30 '16 at 13:50
  • I tried this. Im in windows but still have the same thing – MAYA Aug 31 '16 at 07:12
  • It works when I delete all Files propertystore. Thank yiou – MAYA Aug 31 '16 at 07:18
2

To delete the property key from a node:

MATCH (n) WHERE EXISTS(n.foo) REMOVE n.foo

To delete the property key from a relationship:

MATCH ()-[r]->() WHERE EXISTS(r.foo) REMOVE r.foo

But even after the property key is deleted, the empty key name will for now remain part of the Database Information list for reason that only Neo4j know.

sdittmar
  • 365
  • 2
  • 14