Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-06-2021 02:19 PM
In the Neo4j training course " Querying with Cypher in Neo4j 4.x, " Question 3 in the "Check Your Understanding" section asks "We want a query that returns the names of any people who both acted in and wrote the same movie. What query will retrieve this data?"
The only answer it takes as correct is MATCH (p:Person)-[:ACTED_IN]→(m:Movie) WHERE (p)-[:WROTE]-(m) RETURN p.name, m.title
However, the last answer also seems to work, and I tested it to confirm: MATCH (p:Person)-[:ACTED_IN]→(m:Movie)←[WROTE]-(p) RETURN p.name, m.title
Is there a reason that the second answer is not acceptable other than that it's just in the WHERE clause section of the course?
Solved! Go to Solution.
11-08-2021 04:51 AM
The second pattern uses [WROTE] which is not a relationship specifier, but a reference to a node. And it is not the correct answer.
These 2 queries do not return the same results.
Elaine
11-06-2021 11:34 PM
The only difference between the two queries is first one uses filters and the second one does not.The data set second query uses is analytical data that might have been prefiltered before ingesting into DB.
Thanks
Mr Sameer S G
11-08-2021 04:51 AM
The second pattern uses [WROTE] which is not a relationship specifier, but a reference to a node. And it is not the correct answer.
These 2 queries do not return the same results.
Elaine
All the sessions of the conference are now available online