使用RESTAPI调用(HTTP-GET)从Google Firestore获取特定数据 问题
我想从Google Firestore检索特定数据。 只能获取所有“字段”数据。但字段中没有特定数据 GET请求的示例: 如您所见,可以获取对象“字段”中的所有项。但不可能获得更详细的信息以获得更具体的数据(测试、消息、节点ID等) 试用 我已经试过:使用RESTAPI调用(HTTP-GET)从Google Firestore获取特定数据 问题,rest,firebase,api,google-api,google-cloud-firestore,Rest,Firebase,Api,Google Api,Google Cloud Firestore,我想从Google Firestore检索特定数据。 只能获取所有“字段”数据。但字段中没有特定数据 GET请求的示例: 如您所见,可以获取对象“字段”中的所有项。但不可能获得更详细的信息以获得更具体的数据(测试、消息、节点ID等) 试用 我已经试过: 字段=字段/测试 fields=fields.test 字段=字段(测试) 字段=字段/测试/整数值 预期结果 我希望获得特定数据,如“字段”中对象的字符串/整数值 此示例应返回带有30的integerValue 这个例子应该返回30 解决
- 字段=字段/测试
- fields=fields.test
- 字段=字段(测试)
- 字段=字段/测试/整数值
但是我仍然需要这个答案的更详细的形式,比如只有'EduBox-1234567'检索特定字段的方法是使用
mask.fieldpath
。例如,下面的GET方法:
你会回来吗
{
"fields": {
"nodeID": {
"stringValue": "EduBox-1234567"
}
}
文档参考和。这正是OP所做的,并没有回答如何仅获取
EduBox-1234567
作为查询的答案。您知道如何仅返回EduBox-1234567了吗?
https://firestore.googleapis.com/v1beta1/projects/edubox-49528/databases/(default)/documents/nodes/EduBox-1234567?key=[My_API_KEY]&fields=fields/test
https://firestore.googleapis.com/v1beta1/projects/edubox-49528/databases/(default)/documents/nodes/EduBox-1234567?key=[My_API_KEY]&fields=fields/test/integerValue
{
"fields": {
"nodeID": {
"stringValue": "EduBox-1234567"
}
}