简体   繁体   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查询来显示通过特定数量的路径连接到初始节点的所有节点?

Number of paths or number of hops? 路径数或跳数?

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

I think maybe he's looking for: 我认为也许他正在寻找:

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.

相关问题 Neo4J Cypher排除连接到特定节点的节点 - Neo4J Cypher Exclude nodes that connect to a specific node Neo4j cypher查询以获取与特定其他节点无关的所有节点 - Neo4j cypher query to get all nodes without a relationship to specific other node Neo4j Cypher Query 获取所有子节点,直到到达具有特定关系的节点 - Neo4j Cypher Query to get all sub nodes until reaching a node with a specific relationship NEO4j Cypher查询返回条件为连接节点数的路径 - NEO4j Cypher query to return paths with a condition on the number of connected nodes Cypher (Neo4j) 匹配具有特定长度和值的所有路径 - Cypher (Neo4j) Match all paths with specific length and value neo4j cypher:从查询结果“堆叠”节点 - neo4j cypher: “stacking” nodes from query result Neo4j:根据节点表示路径密码查询结果 - Neo4j: Expres path cypher query result in terms of nodes Cypher 在 neo4j 中查询以查找具有大多数路径匹配模式的特定节点 - Cypher query in neo4j to find specific node with most paths matching pattern 在Cypher Neo4j中查找并计算从一个不超过特定长度的节点开始的所有可能路径 - Find and count all possible paths starting from one node not exceeding specific length in Cypher Neo4j neo4j密码查询可删除中间节点并将其所有父节点连接到子节点 - neo4j cypher query to delete a middle node and connect all its parent node to child node
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM