Can';在neo4j中添加触发器时不创建关系

Can';在neo4j中添加触发器时不创建关系,neo4j,cypher,neo4j-apoc,Neo4j,Cypher,Neo4j Apoc,我用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 lab

我用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'})

我建立了一个社交网络,当一个用户跟随另一个用户时,触发器会自动增加跟随者数量和跟随者数量。但它不起作用,并且我无法在两个用户节点之间创建新的关系“follow”

节点上的标签是一个集合,因此您需要使用IN运算符:

WHERE TYPE(rel)="FOLLOW" 
AND "User" IN labels(followed)
AND "User" IN labels(follower)

节点上的标签是一个集合,因此需要使用IN运算符:

WHERE TYPE(rel)="FOLLOW" 
AND "User" IN labels(followed)
AND "User" IN labels(follower)