我有一个问题。我正在尝试解决一个密码查询。我有两个节点和相关的两个关系。像,如何在neo4j中统计2个关系
有时它的确定。我用查询,
(A)-[:Friend]-(B) with A count (B) return B as newfriend
。 如果我使用
(A)-[:Friend]->(B) with A count (B) return B as newfriend
OR
(A)<-[:Friend]-(B) with A count (B) return B as newfriend
有时它没有返回。有没有可能将我的这种关系归结为一个,因为如果一个朋友与B或B的朋友一起拥有同样的东西。 在此先感谢。
在这种情况下,您可能会发现以下blogpost有趣:http://graphaware.com/neo4j/2013/10/11/neo4j-bidirectional-relationships.html –