2017-10-23 1 views

Antwort

0

Seit Feuerbasis (im Gegensatz zu Firestore) ist ziemlich ausgezogen in Bezug auf die Abfrage, eine Möglichkeit, es zu tun, ist dies:

JavaScript:

const fetchRestaurants = async() => { 
    try { 
     const ids = ["id1", "id2", "id3"] 
     const promises = ids.map(id => firebase.database().ref('/Restaurants/'+id).once('value').then(snap => snap.val())) 
     const restaurants = await Promise.all(promises) 
    } catch(error) { 
     console.log("Error fetching restaurants", error) 
    } 
} 
Verwandte Themen