Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-22-2022 06:09 PM
Hi All,
I am learning the Neo4j.
I am trying to run a query on Movie db
Q> get the name of movies given a person name.
can any one please help me.
thank you
05-22-2022 06:28 PM
If you mean actor when you say person, then the following will find the actors in the matrix movie:
MATCH (p:Person)-[:ACTED_IN]->(:Movie{title: 'The Matrix Reloaded'}) RETURN p.name
If you mean director when you say person, then the following will find the directors of the matrix movie
MATCH (p:Person)-[:DIRECTED]->(:Movie{title: 'The Matrix Reloaded'}) RETURN p.name
I suggest you go through the movie guide in Neo4j browser. It will explain some of these queries:
:guide movie-graph
05-22-2022 06:34 PM
Oops, I realized you wanted the movie given the person. Try these instead:
Movies Laurence Fishburne acted in:
MATCH (:Person{name: "Laurence Fishburne"})-[:ACTED_IN]->(m:Movie) RETURN m.title
Movies directed by Lilly Wachowski:
MATCH (:Person{name: "Lilly Wachowski"})-[:DIRECTED]->(m:Movie) RETURN m.title
All the sessions of the conference are now available online