【问题标题】:How to check the given property is not present or it's greater/less than some value in Gremlin?如何检查给定属性不存在或大于/小于 Gremlin 中的某个值?
【发布时间】:2021-10-20 01:18:36
【问题描述】:

如何检查给定属性不存在或大于/小于 Gremlin 中的某个值?

g.V(1).hasNot('end_date_time').hasNext()

g.V(1).has('end_date_time', gte(current_timestamp)).hasNext()

想要将以上查询合并为一个。

【问题讨论】:

    标签: graph gremlin gremlin-server tinkerpop


    【解决方案1】:

    你可以简单地将or这两个条件放在一起

    g.V(1).or(hasNot('end_date_time'),
              has('end_date_time', gte(current_timestamp))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-24
      • 2014-12-20
      • 1970-01-01
      • 1970-01-01
      • 2016-07-18
      • 2010-10-22
      • 1970-01-01
      • 2021-12-27
      相关资源
      最近更新 更多