I have the following graph
[a1:A]->[b1:B]->[c1:C]->[d1:D]
[a2:A]->[b2:B]->[c2:C]->[d2:D]
^
|
[x1:X]
If I use the query
match p=((:A)-[*]->(:D))
then it returns both path above, but I want to filter the second path out because there is a label X node pointing to node C. What is the query to use that returns only the path that does not contain nodes that are decorated by node label X.
>Solution :
You could try this
MATCH p=((:A)-[*]->(:D))
WHERE NONE(node IN nodes(p) WHERE EXISTS((node)<--(:X)) )
RETURN p