When attempting to delete all nodes from my Neo4j graph database, which I have successfully done many times in the past on smaller datasets, I consistently ran across Error: undefined - undefined
after running this query
MATCH (n) DETACH
DELETE n
I figured the number of nodes I was attempting to delete at once may be too large (>100000), so I then tried this query
MATCH (n)
OPTIONAL MATCH (n)-[r]-()
WITH n,r LIMIT 10000
DELETE n,r
and many variations of it, acting on mostly what I read in this post: Best way to delete all nodes and relationships in Cypher. All returned this error
org.neo4j.kernel.api.exceptions.ConstraintViolationTransactionFailureException: Cannot delete node<32769>, because it still has relationships. To delete this node, you must first delete its relationships.
and each time, the node Neo4j could not delete differs. Is there any way of resolving this issue?
Perhaps also noteworthy, while desperately running variations of the previous query, when I ran this query
MATCH ()-[r]-()
OPTIONAL MATCH (n)-[r]-()
WITH r,n LIMIT 10000
DELETE r,n
I got this rather unique error
Java heap space
in the console, which showed up as Neo.DatabaseError.General.UnknownError
in the banner.