Hello,
I'm fairly new to Gremlin and need to emit an element before jumping into a loop. Is there a way to do this?
So, given a graph with alternating edges like this:
A(1) --gives--> B(2) <--takes-- C(3) --gives--> D(4) <--takes-- E(5) --gives--> F(6)
I have the following query:
g.v(2).as("x").in("takes").out("gives").loop("x"){ it.object.in("takes").hasNext() }{ true }
This query emits D and F, I would like B, D, and F.
Alternatively, is there a better way to structure this traversal?
Many thanks!
Jonas