4

我想列出我参演的所有电影以及每部电影中的演员总和,但下面的查询只返回除我之外的演员总和,不会返回没有其他演员的电影。

start me=node({0}) 
match me-[:ACTS_IN]->movie<-[:ACTS_IN]-otherActors 
return movie, count(*) as actorSum
4

1 回答 1

5

您需要将其与WITH. 您的查询的问题是您me在 的第一部分声明节点match,因此me永远不能在otherActors.

start me=node({0}) 
match me-[:ACTS_IN]->movie
with movie   
match movie<-[:ACTS_IN]-actors 
return movie, count(*) as actorSum
于 2013-09-09T05:20:39.430 回答