首页 > 解决方案 > 如何排除不包含值的顶点

问题描述

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

带有属性颜色的顶点标签“苹果”,例如创建了一个带有属性颜色多个值的“苹果”顶点 ['red', 'white']

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

问题是它仍然返回这个顶点,我怎样才能排除包含'wh'的V?

标签: gremlinamazon-neptune

解决方案


您可以通过使用not步骤来做到这一点:

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

仅当所有颜色值不包含“wh”时,您的查询才会过滤顶点

并且您可以过滤一个或多个值是否包含“wh” notcontaining

示例:https ://gremlify.com/85


推荐阅读