This Cypher query should work (if the picked node has a myId value of 123):
MATCH p=(n { myId:123 })-[*]-()
UNWIND FILTER(x IN NODES(p) WHERE x <> n) AS node
RETURN DISTINCT node;
The FILTER function filters out the picked node, even if there are paths that cycle back to it.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more