I would like to match a path where the end nodes share the same property value. Let me use Neo4J's classic movies dataset to illustrate my question
Suppose I want to find out scenarios where a director has a working relationship with two or more actors that share the same birth year. That is,
(1) the director had directed a movie where there was two or more actors that share the same birth year; or
(2) the director had directed multiple movies, where the different actors in each different movies share the same birth year.
I don't have any fixed particular director, movie or actors in mind. I've attempted the following cypher syntax:
However, my syntax looks very convoluted given that this is a simple query. In addition, I'm limited to just finding two actors with the same birth year with this syntax of mine. I also want to find cases where there are three, four or more actors with the same birth year having a working relationship with the director. Lastly, I'm not even confident whether or not this syntax of mine satisfies scenario (1), where the director directed a single movie and that single movie has multiple actors with the same birth year
Would appreciate advice on how I can improve on my search. Thank you!