首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用于BatchWrite的FireStore REST结构

用于BatchWrite的FireStore REST结构
EN

Stack Overflow用户
提问于 2022-11-27 09:45:47
回答 1查看 20关注 0票数 1

当您想要在FireStore上创建单个文档时,我知道如何编写JSON。

代码语言:javascript
复制
# Query String
"updateMask.fieldPaths": [
"`price`",
"`status`"
]
# Body
"fields": {
"price": {
"stringValue": "165.00"
},
"status": {
"stringValue": "active"
}
}

但是当涉及到BatchWrite时,我无法理解文档意味着什么,https://cloud.google.com/firestore/docs/reference/rest/v1/projects.databases.documents/batchWrite

目前,我正在使用部署在云计算资源(pipe梦)上的Python来完成这个任务,但是我希望在Make.com及其"Make调用“模块中这样做,因此我需要了解curl风格或REST语法。

我假设字段转到"writes",但不确定"labels"对象是什么。这个电话的写结构到底是什么?

EN

回答 1

Stack Overflow用户

发布于 2022-11-28 03:12:51

代码语言:javascript
复制
{
  "writes": [
    {
      "update": {
        "name": "projects/project_id/databases/(default)/documents/service_order/352003090342435.5f357270173e8c70878.-9486573",
        "fields": {
          "managed_by": {
            "booleanValue": "false"
          },
          "location2": {
            "booleanValue": "false"
          },
          "made_by": {
            "stringValue": "352003090342435.5eda4f3c17284c58460.90921842"
          },
          "phone2": {
            "stringValue": "0665439307"
          },
          "state": {
            "stringValue": "confirm"
          },
          "write_date": {
            "stringValue": "1597664391000"
          },
          "made_by_name": {
            "stringValue": "FaridBenabdallah"
          },
          "description": {
            "stringValue": "e1"
          },
          "accepted_offer": {
            "booleanValue": "false"
          },
          "id": {
            "stringValue": "352003090342435.5f357270173e8c70878.-9486573"
          },
          "location1": {
            "stringValue": "352003090342435.5f3572a0173e8c7c336.-8281409"
          },
          "date_order": {
            "booleanValue": "false"
          },
          "order_type": {
            "stringValue": "Minuiserie"
          },
          "phone1": {
            "stringValue": "0657331995"
          }
        }
      },
      "updateMask": {
        "fieldPaths": [
          "managed_by",
          "location2",
          "made_by",
          "phone2",
          "state",
          "write_date",
          "made_by_name",
          "description",
          "accepted_offer",
          "id",
          "location1",
          "date_order",
          "order_type",
          "phone1"
        ]
      }
    }
  ]
}

This another stackoverflow article帮了我

如果存在null,则需要将预期的值类型更改为nullValue

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74588963

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档