0
votes

I am using AWS Neptune gremlin, I have a vertex with a property stored multiple values

Vertex label 'apple' with property color, e.g. created a 'apple' vertex with property color multiple values ['red', 'white']

g.V().hasLabel('apple').has('color', TextP.notContaining('wh'))

the problem is it still returns this vertex, how can I exclude the V that contains 'wh'?

1

1 Answers

1
votes

You can do this by using not step:

g.V().hasLabel('apple').not(has('color', containing('wh')))

Your query filters the vertices only if all the colors values don't contains 'wh'

with not and containing you can filter if one or more values contain 'wh'.

example: https://gremlify.com/85