【问题标题】:How do I query orientdb for documents without a certain property如何在 orientdb 中查询没有特定属性的文档
【发布时间】:2014-10-16 08:22:02
【问题描述】:

我想查询具有特定属性的文档。

我尝试了以下方法:

select * from Foo where not bar is null

但这会将文档返回给我,即使它们没有该属性。即使它可以工作,但如果存在具有 null 作为值的属性(不知道 orientdb 是这样工作的),它会给出错误的结果。

有没有办法通过sql检查属性是否存在?

【问题讨论】:

    标签: orientdb


    【解决方案1】:

    试试:

    select from Foo where bar is defined
    

    【讨论】:

    • 谢谢!像魅力一样工作。
    【解决方案2】:

    如果你想查询没有特定边的顶点

    select from Users where first(outE('born_in')).@rid is null
    

    【讨论】:

      猜你喜欢
      • 2022-06-12
      • 1970-01-01
      • 2015-05-23
      • 1970-01-01
      • 1970-01-01
      • 2011-12-09
      • 1970-01-01
      • 2014-09-26
      • 1970-01-01
      相关资源
      最近更新 更多