Hi @alexander.dietz ,
Good catch! That guide could be improved to illustrate potential errors. In this case, the constraint failure indicates that it is not possible to assert the uniqueness of Movies based on the title of the movie, because more than one node has that title.
To check that this is the case, you could run this query:
RETURN m.title, count(m)
The result will be a table of movie titles along with a count of how many movies have that title. All movies should have a count of 1. If the counts are more than 1 then it is possible that the data set creation was run more than once in the previous step of the guide.
To "reset" the database to an empty state, you can use this query to find all nodes and delete the nodes plus any existing relationships:
MATCH (n) DETACH DELETE n
After running that, you could repeat the guide from the beginning.
The guide could be improved in a few different ways. Which of these do you think would be more helpful?
- create constraints before creating the data to avoid duplication
- add information about the potential duplication and what to do about it
- change the data creation to use a more advanced "upsert" style to avoid duplication
- other suggestions?
Hope this helps