繁体   English   中英

Neo4J / Cypher需要帮助编写查询,以显示通过特定数量的路径连接到初始节点的所有结果节点

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM