【问题标题】:Gremlin query to get vertices starting with a prefixGremlin 查询以获取以前缀开头的顶点
【发布时间】:2020-05-20 14:17:58
【问题描述】:

我正在尝试获取以 JAVA 中特定前缀开头的顶点。我使用了 between 谓词。有没有更好的方法来做同样的事情。 例如,如果我需要以“a”开头的顶点。我会用

.has(label, propertyKey, P.between("a", "b"))

【问题讨论】:

    标签: java gremlin janusgraph


    【解决方案1】:

    自 TinkerPop 3.4.0 发布以来,Gremlin 也支持简单的文本谓词

    在这种情况下,您应该使用startingWith

    .has(label, propertyKey, TextP.startingWith("a"))
    

    示例:https://gremlify.com/ad

    【讨论】:

      猜你喜欢
      • 2017-10-24
      • 1970-01-01
      • 2019-06-02
      • 2018-02-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-12
      相关资源
      最近更新 更多