Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-16-2021 01:15 PM
How do I change this cypher to not return Lana and Lily Wachowski?
MATCH (p:Person)-[:WROTE]->(m:Movie)
WHERE NOT m.title = 'Speed Racer'
RETURN p.name;
They still shows up because they wrote another movies
This is exercise 3.2 page 7
03-18-2021 11:46 AM
Since this one is for a learning exercise, I'll give a hint.
Your current MATCH returns paths for persons who wrote movies. So if a person wrote 5 movies, they will have 5 matching paths, one per movie.
Your WHERE excludes all those where that movie is Speed Racer (but keeps all others, and as you note since they wrote other movies, those paths are not excluded).
First, consider if there are alternate ways to query for a "person...where they wrote a movie", where you get only one row per person, instead one row per "person who writes this movie".
Once you've solved that, consider how to exclude "persons who wrote Speed Racer" without changing or using MATCH to do so.
All the sessions of the conference are now available online