【问题标题】:Why does the documentation for Cypher's exists predicate say it accepts a pattern when it doesn't?为什么 Cypher 的存在谓词的文档说它接受一个模式而不接受?
【发布时间】:2022-01-20 14:17:21
【问题描述】:

exists 谓词的文档说它接受模式或属性。

这是一个简单的模式,它返回一个值

match (u:User) return u

这会将相同的模式传递给exists,然后返回错误。

return exists((:User))

错误状态

Invalid input ':': expected "NOT", an expression or an identifier

这表明exists 需要一个表达式或一个标识符,但如果传递一个基本模式会阻塞。

然而这有效,并返回true

return exists((:User)-->(:Account)) 

这表明exists 适用于某些模式,但不适用于其他模式,文档没有提供关于我们应该期望什么工作以及什么不工作的线索。

发生了什么事?是我误解了什么,还是 exists 谓词实施和/或记录不当?

【问题讨论】:

    标签: neo4j cypher


    【解决方案1】:

    我想你可以像这里一样做类似的解决方法:https://twitter.com/graphileon/status/1471059683121184769?s=21

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-22
      • 1970-01-01
      • 1970-01-01
      • 2017-08-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多