如何在密码查询中使用两个匹配语句

Mon*_*key 6 neo4j cypher

我想将两个请求合并到一个查询中,我不确定当在一个cypher查询中使用2个匹配语句时会发生什么.

说我有一个朋友列表,我希望看到我的朋友列表,他们的每个叔叔和兄弟姐妹都列在一个集合中.我可以使用两个匹配语句来完成这项工作吗?例如

match friends-[:childOf]->parents-[:brother]->uncles
    , friends-[:childOf]->parents<-[:childOf]-siblings
return friends, collect(siblings), collect(uncles)
Run Code Online (Sandbox Code Playgroud)

但是,如果我执行这样的查询,它总是不返回任何结果.

Gop*_*opi 7

由于你已经在第一场比赛课程中选择了父母,你可以这样做 -

match friends-[:childOf]->parents-[:brother]->uncles
with friends, parents, uncles
match parents<-[:childOf]-siblings
return friends, collect(siblings), collect(uncles)
Run Code Online (Sandbox Code Playgroud)