gpt4 book ai didi

rest - firebase - Firestore REST API 启动查询

转载 作者:行者123 更新时间:2023-12-02 23:26:55 35 4
gpt4 key购买 nike

您好,我是 firestore 的新手,我正在尝试使用其余 API 从名为 Users 的集合中进行查询,查找具有名为 about 且值为 test2 的字段的所有用户

这是我的 POST 请求:

https://firestore.googleapis.com/v1beta1/projects/ {myprojectid}/databases/(默认)/documents/Users:runQuery

正文:

{
"structuredQuery": {
"where" : {
"fieldFilter" : {
"field": {"fieldPath": "about"},
"op":"EQUAL",
"value": {"string": "test2"}
}
},
"from": [{"collectionId": "Users"}]
}
}

我收到回复

{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"structured_query\" at 'document': Cannot find field.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "document",
"description": "Invalid JSON payload received. Unknown name \"structured_query\" at 'document': Cannot find field."
}
]
}
]
}
}

有人可以告诉我我做错了什么吗?多谢。我陷入困境,无法继续。

最佳答案

在您的 URL 中删除用户。

https://firestore.googleapis.com/v1beta1/projects/ {myprojectid}/databases/(默认)/documents:runQuery

关于rest - firebase - Firestore REST API 启动查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49723881/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com