我的火力地堡陣列的結構如下:從火力點陣列
[
{
'userId': '12345',
'itemOrdered' : 'abc',
'status': 'pending'
...other attributes
},
{
'userId': '6789',
'itemOrdered' : 'def',
'status' : 'pending',
...other attributes
},
{
'userId': '12345',
'itemOrdered' : 'def',
'status' : 'complete',
...other attributes
},
]
我無法弄清楚如何檢索以下數據:
- 獲取記錄用戶id = XXX
- 獲取所有記錄,其中「itemOrdered」 = '高清'
火力地堡文檔談論使用orderByC但這並沒有多大意義。
[避免在分佈式系統中使用數字順序標識(即數組)。](https://www.firebase.com/docs/web/guide/understanding-data.html#section-arrays-in-firebase)。真? [是的,真的](https://www.firebase.com/blog/2014-04-28-best-practices-arrays-in-firebase.html) – Kato