I'm using neo4j on a linux machine 16G memory
and I'm trying to delete all the graph .
it has 11353056 relationship vs 19900 nodes.
when I run Match (n) detach delete n
after loading for a while I get thee out of memory error .
how can I delete the graph ? should I proceed by deleting the relationships and then delete the nodes to prevent that problem ?
Do like this to remove records with a limitation:
MATCH (n)
WITH n LIMIT 10000
DETACH DELETE n
RETURN count(*);
If you want to remove everything like property keys, stop neo4j service and remove everything from data/graph.db
Instead of use Cypher to delete all the graph you can I stop Neo4j and delete the data/graph.db
folder. After it restart Neo4j.
Another suggestion is to run your deletion query with a limit repeating it until no more records exists.
For example:
Match (n) detach delete n limit 5000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With