What I’m trying to achieve is having random IDs in a dedicated node in Firebase Realtime Database, while being able to check if an ID already exists in the node before writing it to prevent duplicity. I’m working with web React (JavaScript). The database currently looks like this: What I’m aiming for is to have another node with IDs in
Tag: firebase
FlatList conditional rendering if {user === owner || gues}
In my Applikation I render a Expo FlatList to show created Events. If the user has created or joined this event, he should be able to see the images. If not, they should be hidden. I would now store the creator and the guests in the database and would have to compare this with the currentUser from the Firebase Auth
How to merge duplicate Firestore documents?
I want to create a function that loops through an array and creates a new document in the Firestore database with an id and quantity fields for each element in the array but I want the function to merge the documents if the another document with the same id already exists I tried the following code: but it did not
Firebase Storage – Web v9 – how to check if file exists in bucket?
Currently I’m using getDownloadURL() and error handling like this which works, but kind of feels like a workaround. So I’m wondering if this is the way to go or if there’s a better alternative. Maybe I’m missing a build in way to directly request the existence? (with ‘Web v9’ options) Answer There isn’t any direct way like exists() to check
Expo Camera Photo Upload To Firebase Storage is undefined – React Native
I am using import { Camera } from ‘expo-camera’; to take pictures. The taken picture is stored in the devicecache. so far so good. Now I am trying to upload this taken images to Google Firebase Storage using import { getStorage, ref, uploadBytes } from “firebase/storage”; The return of doing a photo is: Now I try to upload this like
Firebase Storage Web: uploadTask.cancel() is not working reactjs
I want to cancel the upload task at the click of a button. But it is not working(it returns false and I can view the file in the firebase storage console) below is the full code of the component Upload.js Here is what’s happening in the console after I click on cancel(after clicking upload and setting a file(img, 3.15mb)) if
Firebase database. How to append values to array?
I have the following test data My question is how do I correctly append new value to an array without overwriting it? My idea was to retrieve existing data then spread it like so […currentData, “bob”]. Is there a better alternative? Answer There is no atomic operation to add an item to an array directly in the database. This means
Givenname and Familyname claims are missing in firebase idtoken
I am trying to use Firebase to implement google login for our web application. here is what I have done to get the idtoken : Although I have added the profile scope still I can not get the givenname and familyname claims in the idtoken ( email , picture and name are avialable) (I have tried directly to use Google
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
How to return data from Firestore query to a FlatList
I’m new to React-Native and I am trying to return the array of data from the firstore query to the device screen where I can setDevices. I had this working using .get() and .then(), but I wasn’t getting the updated events, so I’ve moved to onSnapshot and seem to have data at the query end, but can’t get this set