如何利用nebula查询多个vertex的共同邻居?

As titled, 如何求共同邻居?

使用cypher
match (a:tagName)-[e1]->(neighbor)<-[e2]-(b:tagName) where id(a) == “xxx” and id(b) == “yyy” return neighbor

使用 ngql
go from “xxx” over edgeName yield edgeName._dst as id
intersect
go from “yyy” over edgeName reversely yield edgeName._dst as id

1 个赞

如果不是vertex, 而是edge呢, 比如有一个edge: fund_with(src_account string, dst_account string), 给定多个account, 判断这些account的共同邻居

你的意思是 多个account 都连接到同一个点 然后找到这个点吗

不是,多个account都是edge的属性,如果找这些account的共同邻居? 共同邻居即都和这些account产生交易的account.

如果Account不是点又何来共同邻居的说法。建议把你的模型详细描述下,最好给些例子,方便大家帮忙出主意。

2 个赞

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。