【问题标题】:Neptune with gremlin error when creating edge海王星在创建边缘时出现 gremlin 错误
【发布时间】:2021-10-28 17:36:34
【问题描述】:

我是新的海王星和图形数据库,并试图在两个顶点之间创建一条简单的边,并得到一个我不完全理解的奇怪错误。

const user = await g.V().has('name', 'john').next()
const group = await g.addV("group").property("name", 'johns created group').next()
 const edge = await g.V(user).addE('memberOf').to(g.V(group)).next(); // this line causes error

第三行导致我收到以下错误

Error: The child traversal of ... was not spawned anonymously - use the __ class rather than a TraversalSource to construct the child traversal

关于发生了什么或如何解决此问题的任何想法?

【问题讨论】:

    标签: gremlin graph-databases amazon-neptune


    【解决方案1】:

    在 TinkerPop 3.5.0 之后,您不能再从 g 生成子遍历。它必须从 __ 匿名生成,因此:

    g.V(user).addE('memberOf').to(__.V(group))
    

    更多信息可以在Upgrade Documentation 中找到 3.5.0。

    【讨论】:

      猜你喜欢
      • 2019-09-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多