Testing Patterns

Rob Reiner directed

Write and execute a query to return the titles of all movies that Rob Reiner directed, but did not act in.

How many Movie titles are returned?

  • ✓ 14

Hint

Use NOT exists {<pattern>}.

Once you have entered the answer, click the Try Again button below to continue.

Solution

You can run the following query to find the answer:

cypher
MATCH (p:Person)-[:DIRECTED]->(m:Movie)
WHERE p.name = 'Rob Reiner'
AND NOT exists {(p)-[:ACTED_IN]->(m)}
RETURN DISTINCT m.title

How many movie titles does it return?

Once you have entered the answer, click the Try Again button below to continue.

Summary

In this challenge, you tested patterns in the graph.

In the next challenge, you will profile a query.