I'm working with a Neo4j data set that looks like this:
I'm trying to write a query that returns all paths from the green node 84
to node 88
that also returns/includes the blue nodes that have a Files
relationship to the gray nodes along the paths
So far, my query looks like this:
MATCH (startingstatus:green {id: 84}),
(endingstatus:green {id: 88}),
path = (startingstatus) - [StatusOut*0..5] -> (endingstatus),
(scenario:gray) - [Files] -> (form:blue)
RETURN *;
The problem is that right now, the query returns every gray - [Files] -> blue
relationship in the database (e.g. the image above), I only want the blue nodes with the relationship to the gray node with the ids 4
, 20
, and 21
since those are the nodes along the path.
I hope this makes sense. I apologize for having to rename some of the nodes.