【问题标题】:Google Cloud Datastore JSON for an Array of Keys用于键数组的 Google Cloud Datastore JSON
【发布时间】:2018-01-22 10:56:23
【问题描述】:

我在 Google 数据存储控制台中尝试使用此 JSON 将属性创建为键数组(一对多关系),但它不起作用:

{
    "values": [
        {
            "keyValue": key(user, 1234567890123456)
        },
        {
            "keyValue": key(user, 6544567890123456)
        },
    ]
}

【问题讨论】:

    标签: arrays json key google-cloud-datastore


    【解决方案1】:

    查看 JSON 格式:https://cloud.google.com/datastore/docs/reference/rest/v1/Key

    JSON 将如下所示:

    {
      "values": [
        {
          "keyValue": {
            "path": [
              {
                "kind": "user",
                "id": "1234567890123456"
              }
            ]
          }
        },
        {
          "keyValue": {
            "path": [
              {
                "kind": "user",
                "id": "6544567890123456"
              }
            ]
          }
        }
      ]
    }
    

    【讨论】:

    • 完美。非常感谢。输入您提供的准确 JSON 代码后,GC 控制台欣然接受。
    猜你喜欢
    • 2021-06-28
    • 2018-12-29
    • 1970-01-01
    • 2014-07-30
    • 1970-01-01
    • 1970-01-01
    • 2020-12-30
    • 2021-10-31
    • 2023-03-20
    相关资源
    最近更新 更多