graph - 如何在 gremlin 中使用`startsWith()` 进行遍历?
问题描述
如何startsWith()
在 gremlin 中遍历使用?
g.V('6b4e7018-a2d1-45fd-a1ce-78efe4c96c33').bothE(startsWith('live_at_'))
.elementMap().toList()
或者
g.V('6b4e7018-a2d1-45fd-a1ce-78efe4c96c33').bothE().hasLabel(startsWith('live_at_'))
.elementMap().toList()
列出所有edges
以标签开头的live_at_
。
解决方案
知道了,我们需要使用startingWith()
而不是startWith()
g.V('6b4e7018-a2d1-45fd-a1ce-78efe4c96c33').outE().hasLabel(startingWith('lives_at_'))
.elementMap().toList()
推荐阅读
- javascript - Javascript 正则表达式匹配相同的字符旁边存在
- python - Scipy.Optimize.Minimize 不满足约束之一
- amp-html - 未找到结果时如何显示消息
- android - Android 振动不适用于版本 10 及更高版本
- sql - 由于语法错误,SQL 查询不会运行
- javascript - NextJS - 引用错误:文档未定义
- c# - 如何在 LINQ 中使用组
- azure - 如何将文件从本地磁盘复制到 AKS VMSS(所有 Azure 虚拟机规模集)
- parameters - 调用 API 在 JMeter 中显示参数丢失错误
- wordpress - WooCommerce 订阅插件是否使用瞬态?