Gremlin 重复直到返回路径上的边()
Gremlin Repeat Until Returning Edges on path()
我正在尝试提出一个 gremlin 查询来查找谁是雇员并且知道 "Jack"。我也有兴趣在路上和边一起去了解他们为什么认识对方
这里是它的代表
这是我想出的查询,但没有得到边缘。
g.V().has('isSSEmployee',true).repeat(both().simplePath()).until(has('name','Jack')).path().limit(10)
为了在路径结果中返回边,您需要在查询中专门引用它们。像这样:
g.V().has('isSSEmployee',true).repeat(bothE().otherV().simplePath()).until(has('name','Jack')).path().limit(10)
希望对您有所帮助。
开尔文
我正在尝试提出一个 gremlin 查询来查找谁是雇员并且知道 "Jack"。我也有兴趣在路上和边一起去了解他们为什么认识对方
这里是它的代表
这是我想出的查询,但没有得到边缘。
g.V().has('isSSEmployee',true).repeat(both().simplePath()).until(has('name','Jack')).path().limit(10)
为了在路径结果中返回边,您需要在查询中专门引用它们。像这样:
g.V().has('isSSEmployee',true).repeat(bothE().otherV().simplePath()).until(has('name','Jack')).path().limit(10)
希望对您有所帮助。 开尔文