较新版本的 Cypher 不再喜欢我的 OPTIONAL MATCH 子句。
Cypher 2.1 的此查询的正确版本是什么?
Cannot add labels or properties on a node which is already bound (line 1, column 104)
"MATCH (n1:Entity {key:"bloomberg michael"})-[r1:RELATED_TO]-(n2:Entity)
WITH n1, r1, n2
OPTIONAL MATCH (n2:Entity)-[r2:RELATED_TO]-(n3:Entity)
RETURN n1, r1, n2, count(n3), labels(n1), labels(n2)
ORDER BY n2.relevance DESC
LIMIT 50"
最佳答案
你能试一下吗
MATCH (n1:Entity {key:"bloomberg michael"})-[r1:RELATED_TO]-(n2:Entity)
WITH n1, r1, n2
OPTIONAL MATCH (n2)-[r2:RELATED_TO]-(n3:Entity)
RETURN n1, r1, n2, count(n3), labels(n1), labels(n2)
ORDER BY n2.relevance DESC
LIMIT 50
关于neo4j - 升级到 neo4j 2.1 破坏了 Cypher 查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24195879/