在我的Firebase实时数据库中,我有表bookings
,其中包含类似数据,
"booking_id1": [
{
"id":"1","name":"ram"
},{
"id":"2","name":"raj"
},{
"id":"3","name":"ramraj"
}
],
"booking_id2": [
{
"id":"4","name":"ram"
},{
"id":"5","name":"raj"
},{
"id":"6","name":"ramraj"
}
]
现在我是否喜欢使用
Firebase.database().ref('/bookings').once("value", snapshot => {
});
它会得出所有数据,例如
{
"booking_id1": [
{
"id":"1","name":"ram"
},{
"id":"2","name":"raj"
},{
"id":"3","name":"ramraj"
}
],
"booking_id2": [
{
"id":"4","name":"ram"
},{
"id":"5","name":"raj"
},{
"id":"6","name":"ramraj"
}
]
}
但是我只想使用id=4
获得对象。喜欢,
{
"booking_id2": [
{
"id":"4","name":"ram"
},{
"id":"5","name":"raj"
},{
"id":"6","name":"ramraj"
}
]
}
任何建议都会有所帮助...谢谢