如何在 gremlin 中使用 `startsWith()` 进行遍历?

How to traverse using `startsWith()` in gremlin?

如何在gremlin中使用startsWith()遍历?

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()

在 Azure 版本的 Gremlin 中——我们使用以下方式

.has('someattrname', TextP.startingWith('xyz'))