neo4j-graphacademy / app-python

https://graphacademy.neo4j.com/courses/app-python
56 stars 92 forks source link

Stuck at challenge: Unique Email Addresses #4

Closed Ravineesh closed 2 years ago

Ravineesh commented 2 years ago

I've been trying to pass the test case for Challenge: Unique email addresses, but the test case is failing:

image

To complete the task, one should insert the constraints in the Neo4j sandbox but running the constraint in the sandbox is giving me the below error. Before applying this constraint there are a few nodes, which already share the same email address, as result the constraint is failing.

image

Ravineesh commented 2 years ago

This issue is resolved now.!

shashank1623 commented 1 year ago

how you solve this error can you help me plss!

adam-cowley commented 1 year ago

This error occurs when two nodes already exist with the same property, meaning the constraint is already violated and can't be created.

If you delete one of the users with that email address, you should be able to create the constraint.

MATCH (u:User)
WITH u.email AS email, collect(u) AS users
WHERE size(users) > 1
FOREACH (u IN tail(users) | DETACH DELETE u)
shashank1623 commented 1 year ago

This error occurs when two nodes already exist with the same property, meaning the constraint is already violated and can't be created.

If you delete one of the users with that email address, you should be able to create the constraint.

MATCH (u:User)
WITH u.email AS email, collect(u) AS users
WHERE size(users) > 1
FOREACH (u IN tail(users) | DETACH DELETE u)

thanks a lot but still this application has lot of error after completing all the challenges.

adam-cowley commented 1 year ago

Did this query solve this issue for you? Can you please open a new issue with the details of the other errors?