When deleting a large number of nodes (1000+), it's important to stagger the delete operations so as not to overwhelm the database.
When learning Neo4j you may have used this query
MATCH (n) DETACH DELETE(n)
Instead, APOC's periodic iterate function can handle this for you in a better way.
For example, you can do it like this (not an optimal version):
"MATCH (n) RETURN n",
"DETACH DELETE n",
Note setting parallel to true can lead to contention. We advise you start setting it to false.
Since Aura has some safeguards for its query memory and is running a database version greater than 4.x you should use this improved method instead:
"MATCH (p) return id(p) AS id",
"MATCH (n) WHERE id(n) = id DETACH DELETE n",
If you have dense nodes it may be more efficient to delete the relationships separately then the nodes to avoid any contention/locking;
'MATCH ()-[r]->() RETURN id(r) AS id',
'MATCH ()-[r]->() WHERE id(r)=id DELETE r',
'MATCH (n) RETURN id(n) AS id',
'MATCH (n) WHERE id(n)=id DELETE n',