How to reset the graph data?

I am new to neo4j,when I studied the course of 2-c-add-intermediate-node,I did some wrong steps,the data changed,when I clicked "check database" button,it shows "Try again......".How to reset the graph data?

1 Like

Hello! Are you talking about the Movies Graph Example database?


The other day I did something to duplicate the entire database (can't remember what), using desktop. I decided to delete that db and reinstall it. I used this github link to find scripts/movies.cypher and imported it into desktop. This might be different if you're using Sandbox or Aura? There is probably another way to reset it to the initial database.


Also, I have had luck putting things under Newbie Questions. Hope this helps! :grin:

@82796779

if you want to delete all nodes/all relationships, and still keep all index and constraint definitions you can un

match (n) detach delete n;

which walks all nodes, detaches all relationship from said node, and then deletes said node.

Note if you are working with a graph which has for example 100k nodes you might want to consider batching this and thus perform the deletes in smaller numbers and so as to avoid a single txn which is committing 100k records etc which might lead to a out of memory. To delete in batches and with Neo4j 4.4.x forward see CALL {} (subquery) - Cypher Manual and the section with

MATCH (n)
CALL {
  WITH n
  DETACH DELETE n
} IN TRANSACTIONS OF 2 ROWS

but you probably could increase IN TRANSACTIONS OF 2 ROWS to IN TRANSACTIONS OF 10000 ROWS

Hello @82796779,

Not sure if you were able you were able to complete the challenge on creating intermediate nodes.
If your sandbox terminated and you re-enter the challenge, the sandbox will be automatically reset to where it should be for the beginning of the challenge.

Let us know if you need more help.

Elaine