Gremlin check if a Set attribute contains a value

Viewed 203

I have a vertex with a Set attribute and a graph traversal e.g.

graph.traversal().V().hasId(id)

the returned vertex has a set attribute and I need to check if it contains a specific value

2 Answers
.has("myProp", __.unfold().is("myVal"))

This can be used to check if the value is contained in a set or list

g.V().has('MyProp',__unfold().is(within('someValue','SomeOtherOptionalValue'))
Related