Cypher 将所有传入边的权重加到 Neo4j 中的特定节点?

Cypher to sum the weight of all incoming edges to a particular node in Neo4j?

我想获取 neo4j 中特定节点的所有传入边的汇总权重,例如。 S. Keshav 必须传入加权边缘,首先有 weight =2 ,第二有 weight=4 ,我需要 answer= 6

您可以使用 sum() 函数来完成:

match ()-[r]->({name : 'S. Keshav'})
return sum(r.weight)