+3 votes
in Databases by (21.4k 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

+1 vote
by (51.1k points)

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"     │