DELETE all data from AuraDB

I was trying to delete all data from the database. And I keep having issues.

First, I was told just to stop the server and delete "/data" but it's not possible on AuraDB, and generally it's the wrong solution for the script I'm writing.

Second, it was suggested to use

"CREATE OR REPLACE DATABASE neo4j;"

But it's not supported on AuraDB

Now Third is the approach using Cypher, I found this query:

MATCH (n)-[r]-()
CALL { WITH r
DELETE r} IN TRANSACTIONS OF 10000 ROWS
WITH n
CALL { WITH n
DELETE n} IN TRANSACTIONS OF 10000 ROWS;

And I thought It was working until I got an OutOfMemory error.

dbms.memory.transaction.global_max_size threshold reached

From running "profile" on this query, it turns out that the number of rows in the transaction has no impact on memory usage because the first fetch is eager. To be clear increasing memory is not an option.

I'm completely out of ideas. Any help is greatly appreciated.

On the Aura console - click the overflow menu (the elipsis). There is a menu item that says "reset to blank"

Hi,

Have you tried the more basic deletion method

Match (n) detach delete n

I think the detach statement is important because it removes the relationships to each node.

Andy

Thanks for the suggestion, But unless it's possible via some API call, It's not gonna work for my script.
I need to be able to do this programmatically like "drop database" + "create database" in Postgres.

If you think its an overflow issue, maybe delete the information in two phases:

First:

match ()-[n]-()
CALL { 
    WITH n
    DELETE n
} IN TRANSACTIONS OF 10000 ROWS

Second:

match (n)
CALL { 
    WITH n
    DELETE n
} IN TRANSACTIONS OF 10000 ROWS​