Search code examples
memgraphdb

How to clear or flush the on-disk storage in Memgraph


I have my Memgraph database configured to use on-disk storage for memory management. I am wondering if there is any way to flush this storage using a query or command. Does Memgraph provide a specific command or method to clear or flush the on-disk storage?


Solution

  • You can delete everything inside Memgraph via MATCH (n) DETACH DELETE n;. If you have a larger scale, consider limiting deletion to chunks so as not to cause a huge Memory spike. The other option is just starting a fresh instance if setup and configurations can also be deleted.