Question from Cypher's boss. I know how to get all friends of someone named Rebecca, and the edges between them:
MATCH (rebecca:Person)-[r*1..10]->(friends:Friend)
RETURN rebecca, friends,
extract(x IN r | {rel: x, start: startNode(x), end: endNode(x)})
And I know how to get all the friends of someone named Robert, and the edges between them:
MATCH (robert:Person)-[r*1..10]->(friends:Friend)
RETURN robert, friends,
extract(x IN r | {rel: x, start: startNode(x), end: endNode(x)})
But how can I get all the friends that Robert and Rebecca have with each other? Either by combining these two queries, or if there is an easier way overall.
source
share