我有这样的关系:
我想计数,然后计算 :Tweet
节点的所有传入关系的平均值,不包括 ()-[:POSTS]-()
关系。
我应该如何正确地做到这一点?到目前为止,我可以运行此查询来计算所有传入关系的平均值:
match (t:Tweet)-->(topic:Topic)
with topic, size((t)<--()) as rel
where topic.name='politics'
return avg(rel) as Avg_RelationshipCount
谢谢。
最佳答案
感谢一位删除了答案的用户,我找到了解决方案(对他的查询进行了轻微修正):
match ()-[:REPLIES_TO|:RETWEETS]->(t:Tweet)-->(topic:Topic)
with topic, size((t)<-[:REPLIES_TO|:RETWEETS]-()) as rel
where topic.name='politics'
return avg(rel) as Avg_RelationshipCount
关于twitter - Neo4j - 过滤节点之间的关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47420181/