0

When I try to call the firebase Realtime database it gives me this error:

 Uncaught TypeError: Cannot read properties of undefined (reading 'getProvider')

I am writing a code for matching the model text from my code to firebase Realtime database model text My database Structure:-

{
070921210001{
"Model": "modelName"
}
}

and here is How i call my database i have already import all the getDatabase and all :-

  var modelTxt = this.state.models
      console.log(modelTxt)

     
      const dbRef = ref(getDatabase(`/`));
      dbRef.orderByChild(`Model`).equalTo(modelTxt).once("value", function(snapshot){
        console.log(snapshot.val())
      
      }).catch((error) => {
        console.error(error);
      });
MOHAMMAD ZEESHAN
  • 273
  • 3
  • 15

0 Answers0