Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

getting data from firestore using async await

const logCities = async () => {
  let citiesRef = db.collection('cities');
  let allCities = await citiesRef.get();
  for(const doc of allCities.docs){
    console.log(doc.id, '=>', doc.data());
  }
}
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #data #firestore #async #await
ADD COMMENT
Topic
Name
1+3 =