【问题标题】:How to select multiple ids with Gremlin?如何使用 Gremlin 选择多个 id?
【发布时间】:2020-08-25 22:55:05
【问题描述】:

在控制台中,这会返回两个顶点:

g.V('615e6de7-3172-458b-bc68-876fd4f5ecb0','059b6de4-a463-4789-a987-7c2833950b5c')
==>v[615e6de7-3172-458b-bc68-876fd4f5ecb0]
==>v[059b6de4-a463-4789-a987-7c2833950b5c]

但是当我在 Gremlin 中运行它时,我没有得到任何结果:

const idList = `"615e6de7-3172-458b-bc68-876fd4f5ecb0","059b6de4-a463-4789-a987-7c2833950b5c"`;
let traversal = await g.V(idList).toList();

我可以单独获取每个 id,但是在一次遍历中获取多个 id 的语法是什么?

【问题讨论】:

    标签: gremlin tinkerpop amazon-neptune


    【解决方案1】:

    您的代码中的问题是,您尝试发送一个以逗号分隔的 id 字符串。相反,您必须发送一个 id 数组。

    const ids = ['3994', '3997'];
    g.V(ids).properties()
    

    【讨论】:

    • 这行得通,但我必须先将gremlin 更新为 3.4.8。对3.4.4 无效。
    猜你喜欢
    • 2012-10-07
    • 1970-01-01
    • 1970-01-01
    • 2017-09-24
    • 2011-04-13
    • 2014-03-22
    • 2015-02-26
    • 1970-01-01
    • 2020-07-30
    相关资源
    最近更新 更多