cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

Node traversal using cypher query

Hello All ,

I am looking for traversal of nodes on based on the specific node property.
Below is my graph structure and I want to traverse on left or right side based on the specific node

Here if I am filtering out by Node property SS3 , I want to display all the nodes from SS1 till SS3.
I am not able to achieve the same using Cypher , please find the below cypher I have used.
</>
match (n:Schema_Structure{name:'SS3'})
call apoc.path.expandConfig(n,{
relationshipFilter:"Has_Target_SS|Has_Target_Mapping",
minlevel:1,
maxlevel:3,
terminateNode:[n]
})
yield path
return path,length(path) as hops
order by hops;
</>
I tried to change the maxlevel param as well to restrict till SS3 , but its not yielding the desired result.

1 REPLY 1

sylvainroussy
Node Clone

Have you tried something like that first:

match (start:Schema_Structure{name:'SS1'})
match (end:Schema_Structure{name:'SS3'})
match path=(start)-[*]->(end)
return nodes(path)