Retrieving movies in a genre with their reviewers
Find all the movies in the Film-Noir genre and the users who rated them.
Update this query to find the User
nodes that have a RATED
relationship to the Movie
nodes in the Film-Noir
genre.
cypher
MATCH (m:Movie)-[:IN_GENRE]->(g:Genre)
WHERE g.name = 'Film-Noir'
MATCH (?)<-[:??????]-(u:??????)
RETURN m.title, u.name
How many rows are returned?
-
✓ 1140
Hint
The MATCH
clause should use the RATED
relationship to find User
nodes to the Movie
nodes m.
Solution
The answer is 1140
.
You can run the following query to see the result:
cypher
MATCH (m:Movie)-[:IN_GENRE]->(g:Genre)
WHERE g.name = 'Film-Noir'
MATCH (m)<-[:RATED]-(u:User)
RETURN m.title, u.name
Summary
In this challenge, you executed a query to retrieve movies and reviewers that have values in the graph.
In the next challenge, you will modify the query to expand what results are returned by optionally matching rows.