我用 apoc.trigger.add 创建了一个触发器:
CALL apoc.trigger.add('increase_followings_and_followers',
'UNWIND {createdRelationships} AS rel
WITH rel, STARTNODE(rel) as follower, ENDNODE(rel) AS followed WITH rel, follower, followed
WHERE TYPE(rel)="FOLLOW" and labels(followed)="User" and labels(follower)="User"
SET follower.followings = follower.followings +1, followed.followers= followed.followers+1',
{phase:'after'})
我建立了一个社交网络,当用户关注另一个用户时,触发器将自动增加关注者数量和关注者数量。但它不起作用,我无法在两个用户节点之间创建新关系“FOLLLOW”