[英]Neo4J / Cypher need hel writing a query that shows all the result nodes that connect to an initial node by a specific number of paths
在Neo4J中,如何編寫一個Cypher查詢來顯示通過特定數量的路徑連接到初始節點的所有節點?
路徑數或跳數?
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
我認為也許他正在尋找:
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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.