私の Firebase Array の構造は次のとおりです。
[
{
'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 の使用について説明していますが、あまり意味がありません。