Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在图数据库中,我想知道我从哪条路线经过
例如
路径-1。a -1-2-3-4-5- b
路径 2。a -1-2-7-4-5- b
在上述两个示例中,它通过不同的路线从a点遍历到b 点。在这里,我想确定从哪条路线到达b 点。
您可以使用该NODES函数列出路径中的节点。还有一个RELATIONSHIPS列出关系的功能。
NODES
RELATIONSHIPS
例如,如果此查询在您的问题中找到 2 个路径,它将返回每个路径中的节点:
MATCH path = (a:A)-[*]->(b:B) RETURN NODES(path) AS nodesInPath