Search
 
SCRIPT & CODE EXAMPLE
 

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());
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: req.body empty mongodb 
Javascript :: fill array with random numbers javascript 
Javascript :: express draft 
Javascript :: axios multipart/form-data 
Javascript :: Jquery get value of dropdown selected 
Javascript :: place footer at the bottom of the page react 
Javascript :: get id button clicked react 
Javascript :: how to set validation for email in javascript 
Javascript :: nodejs increase heap size 
Javascript :: angular lifecycle hooks 
Javascript :: jquery calc height based on width 
Javascript :: javascript log Time from Date 
Javascript :: how to concurrently run angular and node 
Javascript :: react native scrollview in modal 
Javascript :: remove array empty values javascript 
Javascript :: React Native Expo Scrollview Scroll to bottom 
Javascript :: time difference in minutes in JS 
Javascript :: jquery each array object 
Javascript :: javascript call function on click give element id 
Javascript :: static folder express 
Javascript :: generate unique id javascript 
Javascript :: javascript set localstorage 
Javascript :: get text inside span vue test utils 
Javascript :: javascript redirect 
Javascript :: javascript redirect another page 
Javascript :: sort array of objects javascript 
Javascript :: linking in react native 
Javascript :: javascript clear classlist 
Javascript :: react native transform 
Javascript :: javascript remove first character from string 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =