当您想要在FireStore上创建单个文档时,我知道如何编写JSON。
# 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"对象是什么。这个电话的写结构到底是什么?
发布于 2022-11-28 03:12:51
{
"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。
https://stackoverflow.com/questions/74588963
复制相似问题