【问题标题】:Is it possible to match paths between two lists of nodes?是否可以匹配两个节点列表之间的路径?
【发布时间】:2021-12-08 09:44:30
【问题描述】:

我试试:

match (a1 {name: "a1"}) match (a2 {name: "a2" }) 
with [a1,a2] as A
match (b1 {name: "b1" }) match (b2 {name: "b2"}) 
with A,[b1,b2] as B
match p=A--B
return p

但它不起作用。

我应该如何告诉它找到两组之间的任何路径?是的,我可以尝试单独的节点对,但是我需要尝试的组合数量是巨大的。 Cypher path matchingLists 的 Neo4j 密码手册对此没有帮助。

【问题讨论】:

    标签: neo4j cypher path-finding


    【解决方案1】:

    如何将查询的最后部分更改为

    match p=(A)—(n)
    Where n IN B
    return p 
    

    【讨论】:

    • 使用match p=(n)--(m) where n in A and m in B 有效。谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-10
    • 2015-09-15
    • 1970-01-01
    • 2021-12-18
    • 2016-03-04
    相关资源
    最近更新 更多