cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

DETACH DELETE n doesn't wipe out everything in the brower

lingvisa
Graph Fellow
MATCH (n)
DETACH DELETE n

This removes all labels and relationships in the graph. But in the browser, label and property names are still there. It doesn't hurt too much. Is there a way to get rid of any trace in the old graph? I usually remove and re-create the database files from the data/databases directory.

Just curious.

3 REPLIES 3

Hi @lingvisa,

Apart from deleting nodes and relationships you need to delete all indexes and constrains you created on top of those. The easiest way is by using the apoc library

CALL apoc.schema.assert({},{},true) YIELD label, key
RETURN *

Yes. The labels are wiped out by the command, but properties still stay there.

Hello @lingvisa

I advice you to also use APOC to delete nodes and relationships:

CALL apoc.periodic.iterate('MATCH (n) RETURN n', 'DETACH DELETE n', {batchSize: 1000})

@alexandra gave you the right way to delete indexes.

But you cannot delete properties. The only way right now is to create a new database

Regards,
Cobra