代码之家  ›  专栏  ›  技术社区  ›  Gyromite

在Gremlin中,经过Both()步骤后,根据我们刚刚遍历的方向进行过滤

  •  0
  • Gyromite  · 技术社区  · 6 年前

    Both() 下面是一个简化的查询:

    g.V("1").Both().Or(<direction was IN>, __.Has("tag", "some Value"))
    

    我也考虑过分开做 In() Out() 步骤,但我看不到一种方法使遍历器在两个方向上都分支。

    1 回复  |  直到 6 年前
        1
  •  2
  •   stephen mallette    6 年前

    我想横穿可能更清楚 In() Out() union() 因此:

    g.V("1").Union(In().has("tag","some Value"),
                   Out().has("tag","some Other Value"))