Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-18-2020 08:48 AM
Hello!
I have a graph: root(neo4j id : 0) -[:include]-> childA(neo4j id 1) -[:include]-> childAA(neo4j id 2) -[:include]-> childAAA(neo4j id 3)
I want match from childAAA reversely along include edge, but stop when the endNode of current edge in node set [0, 1]. In other words root->childA is not in result, but childA->childAA should be in.
I don't know how to write the cypher statement. I'm looking forward to help!
Thanks a lot!
10-18-2020 10:21 AM
You can start from childA(neo4j id 1).
//insert correct node info.....
MATCH childA(neo4j id 1)
CALL apoc.path.subgraphNodes(a, {relationshipFilter:'include>'})
YIELD node
RETURN node
This should give you the desired result.
10-19-2020 08:50 AM
Thank you! I get the method also:
match p = (n)<-[r:include*..]-() where id(n)=3 AND not id(nodes(p)[-1]) in [0, 1] return p
All the sessions of the conference are now available online