在Neo4J中,如何编写Cypher查询,显示通过特定路径连接到初始节点的所有节点?
答案 0 :(得分:1)
路径数或跳数?
start n=node(x)
match path = n-[:TYPE*..3]->end // number of hops *..3 is up to 3 hops
return path
limit 10 // number of paths
答案 1 :(得分:0)
我想也许他正在寻找:
start n=node(x)
match path = n-[*]->end // maybe specify a max length and type?
with count(path) as cnt, end // group by end node, get count of paths
where cnt = <numpaths> // replace <numpaths> with the number of paths you want to match
return end