0
我有以下Firebase
JSON
數據結構;Firebase數據過濾
{
"USERS": {
"YjGJsvCb58OsTThv6JLmK1dMuHr1": {
"Email": "[email protected]"
},
"zQpb7o18VzYsSoTQtT9DNhOqTUn2": {
"Email": "[email protected]"
}
},
"POSTS": {
"-KSe4eJyenccPoC5T0zP": {
"addedByUser": "YjGJsvCb58OsTThv6JLmK1dMuHr1",
"content": "Post 1",
"cost": "600",
"duration": "Quarterly",
"latitude": "51.5099850000001",
"longitude": "-0.133528614416432",
"timestamp": "Tue 27 Sep"
},
"-KSe4q1DXoulArzWm_Zm": {
"addedByUser": "YjGJsvCb58OsTThv6JLmK1dMuHr1",
"content": "Post 2",
"cost": "550",
"duration": "Monthly",
"latitude": "51.5100199999855",
"longitude": "-0.133507191218496",
"timestamp": "Tue 27 Sep"
}
}
}
我想過濾POSTS
,並得到所有POSTS
duration
爲Monthly
或任何用戶已經選擇了有。正如你可以看到每個POST
被分配一個AutoID
。
結果進出口尋找應該吐出:
{
"-KSe4q1DXoulArzWm_Zm": {
"addedByUser": "YjGJsvCb58OsTThv6JLmK1dMuHr1",
"content": "Post 2",
"cost": "550",
"duration": "Monthly",
"latitude": "51.5100199999855",
"longitude": "-0.133507191218496",
"timestamp": "Tue 27 Sep"
}
}
但我不能爲我的生活,通過AutoID
的搜索。我已經嘗試過所有的方法。我已經通過StackOverflow搜索,沒有解決方案似乎工作。我的數據是否正確?我需要AutoID
的原因是有些帖子可能是相同的。
任何幫助將不勝感激。
接受這個答案,如果它解決您的問題:)編碼愉快 – Dravidian