从 firebase REST api 获取没有任何嵌套子数组的第一层数组
Get the 1st tier array without any nested child arrays from firebase REST api
我只想 'get' 通过 REST api 来自我的 firebase JSON 的第一层信息,没有每个对象具有的任何嵌套数组。我如何使用 firebase 执行此操作,以避免必须下载整个数据集?
即从下面的 JSON 我只想 return:
{ "people":[
{"name":"bob"},
{"name":"dave"}
]}
完整数据
{
"people":[
{
"name":"bob",
"measurements":[
{
"measname":"first test",
"weights":[
{
"device":"scaleA",
"weight":78.0
},
{
"device":"scaleA",
"weight":78.2
}
]
}
]
},
{
"name":"bob",
"measurements":[
{
"measname":"first test",
"weights":[
{
"device":"scaleA",
"weight":78.0
},
{
"device":"scaleA",
"weight":78.2
}
]
}
]
}
]
}
编辑:我没有意识到你指定这需要在服务器端。根据这个问题,似乎不可能:Database-style Queries with Firebase
我只想 'get' 通过 REST api 来自我的 firebase JSON 的第一层信息,没有每个对象具有的任何嵌套数组。我如何使用 firebase 执行此操作,以避免必须下载整个数据集?
即从下面的 JSON 我只想 return:
{ "people":[
{"name":"bob"},
{"name":"dave"}
]}
完整数据
{
"people":[
{
"name":"bob",
"measurements":[
{
"measname":"first test",
"weights":[
{
"device":"scaleA",
"weight":78.0
},
{
"device":"scaleA",
"weight":78.2
}
]
}
]
},
{
"name":"bob",
"measurements":[
{
"measname":"first test",
"weights":[
{
"device":"scaleA",
"weight":78.0
},
{
"device":"scaleA",
"weight":78.2
}
]
}
]
}
]
}
编辑:我没有意识到你指定这需要在服务器端。根据这个问题,似乎不可能:Database-style Queries with Firebase