【发布时间】:2018-12-12 20:59:40
【问题描述】:
让我们有一个节点Reference,其属性为rating。假设我们在数据库中有 2 个引用,2 个“阳性”和 1 个“阴性”。
Cypher 查询计数正面引用:
MATCH (positive:Reference{rating:'Positive'}) return count(positive)
返回 2,确定
Cypher 查询以计算 否定 引用:
MATCH (negative:Reference{rating:'Negative'}) return count(negative)
返回 1,确定
Cypher 查询同时计算正面和负面引用。基本上,将前面的两个查询合并到一个查询中。
MATCH (positive:Reference{rating:'Positive'})
MATCH (negative:Reference{rating:'Negative'})
return count(positive) as positive, count(negative) as negative
我预计返回的值为正 2 和负 1。但是,两个结果都是 2。
我错过了什么吗?可能我错了,但我发誓这适用于旧版本的 neo4j(现在我使用的是 3.3.2)。
提前感谢您的帮助。
【问题讨论】: