为什么此查询超时?

时间:2018-08-08 16:20:50

标签: graph cassandra datastax gremlin

我正在尝试更新顶点及其所有子代。我不确定为什么会超时。

v = g.V().has('a', 'id', '1').next()"
"v.property('status', '0')"
"g.V(v).out('e').repeat(property('status', '0'))"

1 个答案:

答案 0 :(得分:2)

我假设您想用“状态”为“ 0”更新顶点及其所有子级,如果是这样,那么您只需要这样做:

g.V().has('a','id','1')
  property('status','0').
  repeat(out('e').property('status','0'))

为什么会超时,您可能会更仔细地查看数据,看看那里是否有周期(例如,一个孩子以某种方式指向祖先?)。我还会考虑使用until()times()设置一个限制,以查看是否可以遍历遍历的深度。

相关问题