cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Cypher Fundamentals Course: wrong query?

In the Cypher fundamentals course, (https://graphacademy.neo4j.com/courses/cypher-fundamentals/1-reading/3-relationships/) the second question of that page, asks "Which MATCH clauses will return the names of the directors of the movie, The Matrix?" and says that the following is the *wrong* answer:

MATCH (m:Movie {title: 'The Matrix'})<-[:DIRECTED]-(p:Person) RETURN p.name

This seems to be eminently correct.  Why is it considered wrong by the training algorithm?  What am I missing here?

1 REPLY 1

There are 2 correct answers:
correct; MATCH (m:Movie {title: 'The Matrix'})<-[:DIRECTED]-(p:Person) RETURN p.name

incorrect:  `MATCH (m:Movie {title: 'The Matrix'})--(p:Person) RETURN p.name

There could be ACTED_IN, WROTE, DIRECTED,  PRODUCED, REVIEWED relationships between a Person node and a Movie node.


correct: MATCH (m:Movie {title: 'The Matrix'})<-[:DIRECTED]-(p) RETURN p.name


incorrect: `MATCH (m:Movie {title: 'The Matrix'})--(p:Director) RETURN p.name

There is no such node label, Director in the graph.