【发布时间】:2018-09-18 07:36:41
【问题描述】:
您好,我是 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."
}
]
}
]
}
}
谁能告诉我我做错了什么?非常感谢。我被卡住了,无法继续。
【问题讨论】:
标签: rest google-cloud-firestore