Re: How to filter out step 3 vertex list based on step 1 vertex

Boxuan Li

Hi Ronnie,

Not sure if it's optimal but this should work:

g.V().hasLabel("VertexB").as("B").in("edgeAB").out("edgeAC").as("C").out("edgeCB").as("B2").where("B", eq("B2")).select("C")

You can also do this in two steps:

b = g.V().hasLabel("VertexB").as("B").next()

FYI, for general gremlin query questions, you can also ask in the gremlin-users mailing list:


Join { to automatically receive all group messages.