+3 votes
in Databases by (71.8k points)
I want to find the list of movies done by an actor in the Neo4J default database for movies. How to write the Cypher query for it?

1 Answer

+2 votes
by (348k points)
selected by
Best answer

Here is the Cypher to get the list of movies Tom Hanks acted in:

MATCH (tom:Person {name: "Tom Hanks"})-[:ACTED_IN]->(tomHanksMovies)
RETURN tomHanksMovies.title as Movies

Some of the movies are as follows:

│"Movies"                │
│"You've Got Mail"       │
│"Apollo 13"             │
│"Joe Versus the Volcano"│
│"That Thing You Do"     │
│"Cloud Atlas"           │
│"The Da Vinci Code"     │