Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

firebase realtime database javascript

componentDidMount(){
   // To Fetch Child Data in JavaScript
    if(!firebase.apps.length){
    
      firebase.initializeApp(config); 
    }
      const user = firebase.auth().currentUser;
      //To Replace Email dot with Comma
      var NewText = user.email.replace(".", ",");
                if (user) {
           firebase.database().ref('Patient_Appointments/'+NewText).on('value',datasnap=>{
 
              if(datasnap.val()){
       
             console.log()
             this.setState({myList:Object.values(datasnap.val())})
    
  
            }
          }
        ) 
      }    
    } 
 
PREVIOUS NEXT
Tagged: #firebase #realtime #database #javascript
ADD COMMENT
Topic
Name
8+2 =