【问题标题】:AWS Neptune TypecastingAWS Neptune 类型转换
【发布时间】:2020-01-29 14:28:14
【问题描述】:

如何在 AWS Neptune 中对顶点属性值进行类型转换。考虑到顶点的初始类型是字符串,我想将其转换为整数。

我尝试了 Stackoverflow 中的一些可用资源进行如下类型转换。

g.V().values('code').map{(''+it).toInteger()}

但这是抛出错误提及

错误消息:令牌识别错误:'it)'"}

似乎无法解析“+”后的“it”。

有没有直接的方法可以在 Neptune 中使用 Gremlin 实现这一点。

【问题讨论】:

    标签: gremlin amazon-neptune


    【解决方案1】:

    Amazon Neptune 不允许将闭包/lambda 作为 Gremlin 查询的一部分。您将在此处找到一些注释 [1]。您可能需要在应用程序中处理任何此类类型转换,或者调整数据模型以将整数用于真正为整数的属性。如果您可以提供示例图表,您可能会提出其他可以尝试的建议。

    [1]https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-differences.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-24
      • 1970-01-01
      • 2019-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-30
      相关资源
      最近更新 更多