I’m going through to update my code for the Firebase version 9 modular form. I am now using onValue. From what I’m reading it returns a function that removes the listener. But I’m still not doing it right because although it functions well at first, when I change the database on the backend with the app open I get the
Tag: firebase-realtime-database
How to call push() function from firebase database
I’m trying to get a unique key from the push function but whenever I call it I get this error: Uncaught TypeError: postsRef.push is not a function at HTMLFormElement. These are my imports: And these are the lines that I use to call the push function: I hope you guys can help me, thank you Answer push is nowadays a
Getting the Data in snapshot.val() but not able to treat it
I was making an app and had to fetch data from Realtime Database. I am getting the data in snapshot.val() like this And Now I want to access this data. When I am trying snapshot.val()[0].email and snapshot.val().[0].email I am Getting So, I am working in React Native and this is the code The nodes of database are as follows: Please
I can’t figure out how to work with the object returned by Firebase get query
I’m building a React Native app with Expo and integrating Firebase (real time database) which I know has some limitations (https://docs.expo.dev/guides/using-firebase/). I’m trying to get a snapshot of the data using await get(query(… and have successfully done so, but I can’t figure out exactly what I’m working with. When I console.log it I get this: I was trying to return
How can I instantly load all my firebase entries without re-rendering?
Circumstances: For my app project that uses a realtime database I’m trying to load in data from all machines that are associated with the user. The machines that the user should see are dependent on the related company (cid) and which machines belong to that company. Problem: I have used the Firebase v9 docs as much as possible and have
Uncaught TypeError while importing from firebase/database
error that i’m getting: Uncaught TypeError: Failed to resolve module specifier “firebase/database”. Relative references must start with either “/”, “./”, or “../”. i am trying to setup firebase configuration for the latest version of firebase 9.1 PS. i have hidden the config on purpose, so thats not the problem. Answer It seems you are using Firebase SDK over CDN so
Firebase – Vue database integration not working
I am trying integrating Firebase with Vue 4 application is currently getting the following error. Uncaught TypeError: db__WEBPACK_IMPORTED_MODULE_1_.default.database is not a function I am using “firebase”: “^9.0.0” “vue”: “^3.0.0” My function call is as below I tried the following the following suggestion but it didn’t work. Thank you! Answer The new modular SDK does not use namespaces anymore. So you
Count all sub child in firebase using React
i have, a data in firebase. the structure look like this what i want is, to count all child inside a uid. so, i expect the values return 4 i have tried like this that return 2 how do i count all children in all uid?. so i can get 4 Answer You can run a forEach loop on the
TypeError: Cannot read property ‘addEventListener’ of null when i want to add new elements to my database
I created a form to create new post from the auth users however im getting this error “Uncaught TypeError: Cannot read property ‘addEventListener’ of null” and cant seem to know why my script is at the end of the HTML and its an external file, I’ve used eventListener in other places and it work just fine. I’ve even checked for
Angular: conditionally render based on whether value was received from Firebase DB
I have a component: I am currently displaying the data I receive inside a swiper in the HTML template with no problems: However, I now want to display the part above only after items have been loaded. And display something else (a loading indicator) while it loads. So I am planning something like this: My only problem is that I