如何查询出度大于1的节点及其关系
比如想查询 出演过2场及以上电影的演员 和 他出演的电影,应该怎么写? match (n:演员)- [r: 出演] -> (m:电影) with n, count® as num where num > 1 return n 可以查询到演过2场及以上电影的演员,但是想获取其出演的电影时 match (n:演员)- [r: 出演] -> (m:电影) with n, f, count® as num where num > 1 return n, f 这样写出来,查询的结果为空
2 回复
with n, f, count® 这个地方count出来的r都是1条,所以你取num>1就全过滤了 match (n:演员)- [r: 出演] -> (m:电影) with n,count® as num match (n)- [r: 出演] -> (m:电影) return n,num,collect(m.name)
试试这个参考一下