我的 Firebase 阵列具有以下结构:
[
{
'userId': '12345',
'itemOrdered' : 'abc',
'status': 'pending'
...other attributes
},
{
'userId': '6789',
'itemOrdered' : 'def',
'status' : 'pending',
...other attributes
},
{
'userId': '12345',
'itemOrdered' : 'def',
'status' : 'complete',
...other attributes
},
]
我无法弄清楚如何检索以下数据:
- 获取 userId = xxx 的记录
- 获取 'itemOrdered' = 'def' 的所有记录
Firebase 文档谈论使用 orderByChild 但这没有多大意义。