Sometimes as an AuraDB Instance administrator, you might just want to delete everything in an AuraDB Instance. This can be performed either from console or via Cypher.
Aura Console solution (for administrator) Aura Professional Only
As an administrator you may prefer something that does not involve Cypher, directly from the Aura Console.
When you have an AuraDB instance and you want to delete everything (all data and metadata, but not the users and roles), you can use the "Reset to blank option" which is available in the Neo4j Aura console (see image below)
When you select the "Reset to blank" option from the drop down, you then see a popup window checking you wish to erase all of the existing data and reset your database instance to blank. To proceed click on the Reset button.
You should notice you database status change to Offline, while the reset is performed.
The reset process is completed when you see your database status return to Running.
Finally, if you want to verify the reset has been successful, connect to the database using the Browser, click on the database icon to reveal the Database Information, where you will see there are no nodes, relationships or properties.
Load an Empty dump Aura Enterprise
For Enterprise tier customers, with the Reset to blank option currently only available for the Professional tier, the quickest way to delete everything (all data and metadata, but not the users and roles) is to load an empty dump to your instance.
You can do this by,
- creating a local dump from a blank Neo4j instance.
- loading the dump file into your AuraDB instance, using,
- Drag and drop your dump option from the console (click on your instance and then select the Import Database - screenshot below)
Cypher solution (for developer)
The Cypher method (requires access to the database itself) can be unavailable for an administrator.
The recommended Cypher way is to use the method described in Deleting large numbers of nodes.
DO NOT USE the following Cypher statement for large data set as this is not suited for large data set as mentioned in the documentation.
MATCH (n) DETACH DELETE n
Important note: Resetting the database instance to blank does not affect the System database (roles, users, RBAC), so it is safe if you just want to delete or remove all the data in the Neo4j database.