I'm new to Cypher and Neo4j (and stack overflows for that matter), so hopefully this question has a simple answer. I read the documentation and Google for hours, but could not find anything to answer this question.
Apparently I need more reputation for posting images, so I will do my best with the text.
I can find the path from one node to another, for example:
MATCH path = (a {name:"a"})-[*]-(x {name:"x"})
RETURN extract(r IN nodes(path) | r);
Which could return something like the following two paths:
(a)-[:RED]->(b)<-[:BLUE]-(c)-[:RED]->(f)<-[:RED]-(g)-[:BLUE]->(h)<-[:RED]-(x)
(z)-[:RED]->(h)<-[:RED]-(x)
So far so good. Of course, there are many other connections and nodes in the database that connect to these nodes, but this is the right way.
I need to find one node along a path that includes two RED relationships:
-[:RED]->(findme)<-[:RED]-
In the two examples above, the paths findme = (f) and (h).
. , ( ). , , RED-.
, :
MATCH (a)-[*]-(b)-[:RED]->(findme)<-[:RED]-(c)-[*]-(x) RETURN findme;
, 5 , 3 .
?