gremlin - 如何排除不包含值的顶点
问题描述
我正在使用 AWS Neptune gremlin,我有一个带有存储多个值的属性的顶点
带有属性颜色的顶点标签“苹果”,例如创建了一个带有属性颜色多个值的“苹果”顶点 ['red', 'white']
g.V().hasLabel('apple').has('color', TextP.notContaining('wh'))
问题是它仍然返回这个顶点,我怎样才能排除包含'wh'的V?
解决方案
您可以通过使用not
步骤来做到这一点:
g.V().hasLabel('apple').not(has('color', containing('wh')))
仅当所有颜色值不包含“wh”时,您的查询才会过滤顶点
并且您可以过滤一个或多个值是否包含“wh” not
。containing
推荐阅读
- visual-studio - Visual Studio 语法高亮 (Unity)
- hive - 连接到 Dataproc 上的 Hive 的 PyHive 出现 VPC_SERVICE_CONTROLS PERMISSION_DENIED NO_MATCHING_ACCESS_LEVEL 错误
- javascript - 有没有办法检查用户是否点击了 JS 打开的窗口中的按钮?
- r - 图中以年份为颜色的多条线
- javascript - 如何将我的 JS 对象转换为 FormData?
- python - Sublime Text&Python3.9运行的程序显示是否正常?
- reactjs - React 和 TypeScript 中的“对象可能未定义”
- excel - 复制粘贴数据,然后对其进行排序,但出现错误
- c# - 删除子节点保留其父节点
- javascript - 重复相同的字母会影响函数 accum(s){ codewars