MATCH path = (:Element {id:"11")-[:CHILD*]->()
RETURN path

or if you only want to return distinct nodes overall you can do

UNWIND nodes(path) as n
RETURN distinct n


> Am 02.10.2015 um 15:42 schrieb Sukaant Chaudhary 
> <[email protected]>:
> 
> Hi,
> I've the graph as shown in the image.
> 
> My requirement are as follows:
> 
> 1. We have to search for nodes 1 to n without knowing the depth of the graph 
> as the depth may vary for all the nodes from 1 to n.
> 
> 2. Here the relation name at the levels will be same.
> 
> 3. When we search for say "2 1" then it should give the result as "all the 
> parents connected above that node and all the child connected below that node 
> with the relation".
> 
> 4. The parent and child can be upto any n level and it should give all the 
> parents and child connected to that node directly or indirectly with the 
> relation.
> 
> 5. Consider here for example:
> 5.1. If "1 1" is searched then it will give the result "2 1", "2 2", "2 3", 
> "n 1", "n 2", "n 3", "n 4", "n 5" with all the relations from up to down.
> 5.2. If "2 3" is searched then it will give the result "1 1", "1 2", "n 3", 
> "n 4", "n 5" with all the relations from up to down.
> 5.3. If "n 4" is searched then it will give the result "1 1", "1 2", "1 3", 
> "2 3", "2 4" with all the relations from up to down.
> 
> <image.png>
> Any help will be really appreciated.
> 
> -Sukaant Chaudhary
> <image004.png> <http://in.linkedin.com/pub/sukaant-chaudhary/33/ba8/479>
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to