如何排除不包含值的顶点

问题描述 投票:0回答:1

我正在使用AWS Neptune gremlin,我的一个顶点的属性存储了多个值

具有属性颜色的顶点标签'apple',例如创建了一个“ apple”顶点,其属性颜色为多个值['red','white']

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

问题是它仍然返回此顶点,如何排除包含'wh'的V?

gremlin neptune
1个回答
0
投票

您可以使用not步骤执行此操作:

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

您的查询过滤所有不包含'wh'的颜色值的顶点

使用notcontaining,您可以过滤一个或多个值包含'wh'。

© www.soinside.com 2019 - 2024. All rights reserved.