【发布时间】:2021-03-25 08:03:49
【问题描述】:
在 Gremlin 中,我试图在我的图中找到所有连接的节点 - 使用 BFS 或 DFS 我不担心遍历方法,因为我将有一个边列表,其中将显示节点之间的连接输出类似于
[
Nodes : [ {id : 1, name: "abc"}, "{id: 2, name : "pqr"],
Edges : [ {id : 100, label : ParentOf, from : 1, to : 2 }, {id : 101, label : ChildOf, from : 2, to : 1 }]
]
我的图表看起来像这样
我的问题在于循环 - 我试图只发出连接的节点,比如我从节点 1 开始
g.V('a07771c3-8657-4535-8302-60bcdac5b753').repeat(out('knows')).until(__.not(outE('knows'))).path().
unfold().dedup().id().fold()
我最终得到了错误
Gremlin Query Execution Error: Exceeded maximum number of loops on a repeat() step. Cannot exceed 32 loops. Recommend limiting the number of loops using times(n) step or with a loops() condition
我正在寻找一种查询跳过已经发出的节点的方法?不完全确定如何做到这一点
【问题讨论】:
标签: azure-cosmosdb gremlin azure-cosmosdb-gremlinapi