I am struggling with a Neo4j problem. My project is using Cypher query to remote Neo4j server.
We have nodes and relationships are connected with others, so there are clusters:
(a)->(b)->(c)->(d), (a)<-(f), (a)<-(g).
Single nodes are not connected with other nodes:
(h), (i), (j).
I want to query a graph contains all nodes connected to node(a) no matter the relationship's direction, (b)->(a) or (a)->(b).
I have read other questions, did google, this is my current query:
MATCH path =(a { ID:'1' })--(neighbor)
RETURN path
But this query only stopped at the first neighbor node, like (a)<-(b), the nodes (c) and (d) are not included.
Please help me and teach me how to include all nodes linked to (a)?
Thank you
Yufan