Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-24-2022 05:49 AM
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?
04-24-2022 10:26 AM
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!
04-24-2022 01:06 PM
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) - Neo4j 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
04-25-2022 05:05 AM
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
08-11-2022 01:31 AM
Hi all, I understand that running:
match (n) detach delete n;
will delete all nodes and relationships - but if I want to reset everything back to the beginning (reset all constraints and load data clauses) how can I do this?
Ideally, I just want a blank graph and start again (maintaining only the files in my import folder and APOC and GDS plugins). Cheers
08-15-2022 04:34 AM
This will totally reset data and indexes/constraints:
CREATE OR REPLACE DATABASE neo4j
All the sessions of the conference are now available online