怎么将match子句的聚合返回结果作为子句给set赋值,如下
match (m:Dog)-[r:Rel]-(n) set m.friendCount = count(distinct n.dogId))
3 回复
@pangguoming match (m:Pig)-[r:Love]-(n) with m,n set m.friendCount = count(distinct n.name)尝试过with,总是返回Neo.ClientError.Statement.SyntaxError: Invalid use of aggregating function count(…) in this context (line 1, column 57 (offset: 56))这错误
count()放在with前
match (m:Pig)-[r:Love]-(n) with m, count(n.name) as friendCount set m.friendCount=friendCount