Search code examples
graphcassandradatastaxgremlin

Why is this query timing out?


I'm trying to update a vertex and all its children. I'm not sure why it's timing out.

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

Solution

  • I assume you want to update the vertex and all its children with "status" of "0", if so then you just need to do:

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

    As to why it might timeout, you might look at your data more carefully to see if you have a cycle in there somewhere (i.e. is a child somehow pointing to an ancestor somehow?). I would consider also setting a limit with until() or times() to see if you can find out how deep the traversal is going.