【发布时间】:2021-10-15 01:12:44
【问题描述】:
我正在尝试进行 API 调用以在我的“用户”集合中创建一个文档,并包含“年龄”和“姓名”作为字段。不幸的是,当我调用 API 时,我创建了 Users>document>collection>document>info,我想省略:Users>document>collection>document>info 但 API 不允许。
请参考下图。
目前我的代码如下所示:
POST https://firestore.googleapis.com/v1/projects/###/databases/(default)/documents/Users/hello/APITest HTTP/1.1
Accept: application/json
Content-Type: application/json
{
"fields": {
"Name": {
"stringValue": "Josh"
},
"Age": {
"integerValue": "23"
}
}
}
我删除了一些部分。
关于如何进行这项工作的任何建议?
【问题讨论】:
标签: firebase google-cloud-firestore