In the Movie Graph which comes with Neo4j as Sample graph, I want to query : Get the movie which has been directed and written by the same person who directed The Matrix
movie.
Here is the query which i am using
Match(m:Movie{title:'The Matrix'})<-[r:DIRECTED]-(p:Person)-[r2]->(n:Movie)
where type(r2)='DIRECTED' and type(r2)='WROTE'
return p,n
This query is not working but if i will put OR clause instead of AND clause. It will work. Using OR clause giving me the list of movie which is written or directed by the same director who directed The Matrix
movie. Please let me know why AND clause is not working with type(r).
MATCH (m:Movie{title:'The Matrix'})<-[:DIRECTED]-(p:Person)-[:DIRECTED]->(n:Movie) OPTIONAL MATCH (p:Person)-[:WROTE]->(n:Movie) RETURN p,n
I think that gets you slightly closer to what you need - Oliver Frost