【问题标题】:Insert an array into a node property in Amazon Neptune using openCypher使用 openCypher 将数组插入 Amazon Neptune 中的节点属性
【发布时间】:2023-02-07 05:50:18
【问题描述】:

我正在尝试使用 openCypher 将一个数组插入到 Amazon Neptune 的节点属性中。有没有办法用 openCypher 做到这一点?

我尝试了以下查询:

MERGE (n:Test { name: 'test', colors : ['blue', 'yellow'] })

错误信息 : "detailedMessage": "需要一个简单的文字但找到了列表。"

如果不支持,如果此基本功能尚不可用,AWS 如何将其发布用于生产。

【问题讨论】:

    标签: amazon-neptune opencypher


    【解决方案1】:

    Neptune 仅支持基于 Set 的数组属性,openCypher 规范不支持这些属性。

    Neptune 确实支持与您希望通过 split()join() 函数实现的功能类似的功能,如下所示:https://docs.aws.amazon.com/neptune/latest/userguide/migration-opencypher-rewrites.html#migration-opencypher-rewrites-lists

    //For writing data
    MERGE (n:Test { name: 'test', colors : 'blue, yellow'})
    
    //For reading data
    MATCH (n:Test
        WITH n, [tag in split(n.colors, ',') WHERE NOT (color IN ['blue', 'yellow'])] AS colors
        RETURN n
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-09
      • 1970-01-01
      • 2014-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多