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

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.

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 :slight_smile:

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 :slight_smile:

Regards,
Cobra

Thanks, Cobra! I encountered the same problem and I spent quite some time trying and trying and asking myself where I miss something

If you want to reset your database you can also do the following:

On Aura - use the Reset Database option on the Instance menu

On Desktop / Self managed instance - run cypher:

CREATE OR REPLACE DATABASE neo4j (replace neo4j with the name of your database)

^ this will typically run a lot quicker as well.

Thank you, Martin!

În lun., 27 iul. 2026 la 18:18, Martin Ohanlon <notifications@neo4jcommunity.discoursemail.com> a scris: