I have created a database in firebase and I have fetch it in react, that is working correctly, but I want to include a search bar to filter the elements, my problem is that when I search for an element everything works but when I delete the text from the search input the elements do not appear again. Answer You
Tag: firebase
Rewrite this Firebase Web SDK Version 8 syntax into Version 9
I have a problem with Firebase in my React Native app. I’ve found a quick fix online, but it’s written in Firebase Web version 8 syntax: How can I rewrite it in Version 9 syntax? Answer You need to pass your settings to the initializeFirestore(app, settings) method. As you will read on this doc page: initializeFirestore(app, settings) initializes a new
React Firebase deleting the wrong document id
I’ve been trying to make a delete operation on a firebase database using Reactjs. I’ve got a bug with my function grabbing the wrong id from firebase. I have a button that calls a handleOpen function which opens a Modal. Modal operations: I’ve got a button that calls a handleDelete function which grabs the document id reference and deletes the
How to combine different paths in firestore version 9
I was using firestore version 8 and used the following code to create alternations in code: I couldn’t find a way to create such alternations in firestore version 9. Do you know how to create alternations in version 9? Answer the way I would approach this with V9 will be the follow: We now have a really nice API reference
How to convert Firestore Timestamp to Date() – Firestore V9
Before updating to V9, I use this: But now, after updating to V9, I run into 2 problems, and the documentation mentions nothing about Timestamp for javascript SDK: firebase.firestore.Timestamp is no longer available to use to check if a field is a Timestamp Object. None of the field has the “toDate()” function any more. So my questions are, with the
Axios in a firebase function returning pending promise even inside two async/await blocks
I have an async/await problems (I know, I know) that makes no sense to me. I’m declaring both functions (child and HOF) as async, and awaiting the returned results before trying to console log them. Surprise surprise, I get pending. The function hangs for 60s and times out (so it seems even my runWith timeout method isn’t working. Also tried
FirebaseError: Expected type ‘Tc’, but it was: a custom Ac object
I’m trying to access all documents from my firestore collection but it’s throwing this err FirebaseError: Expected type ‘Tc’, but it was: a custom Ac object Answer The getDoc() method is used to get a single document and takes a DocumentReference as a parameter. Here todoRef is a CollectionReference and to fetch multiple documents you must use getDocs() instead:
Firebase 9 – How to do new doc ref
Hello guys i’ve been trying to convert this code into modular firebase 9: fb8: const userRef = db.collection(‘Users’).doc(); to fb9: const userRef = doc(db, ‘Users’); But i’m getting this error: FirebaseError: Invalid document reference. Document references must have an even number of segments, but Users has 1. Please help! Answer The doc() method is equivalent to .collection(‘users’).doc(‘docID’) where you need
MFA Firebase & React Flow
I am trying to enroll a user with Multifactor authentication with Firebase following this setup guide: https://cloud.google.com/identity-platform/docs/web/mfa I am struggling to figure out how to have my function wait for the user inputted verification code after the code is sent to the user’s phone (I think this is why the code is erroring.) My current code snippet below will throw
Firestore: Unable to read document data (Uncaught TypeError: docSnap.exists is not a function at HTMLFormElement)
I am a new developer with no experience in Web apps. I have a collection called “users” in Firestore in which the document IDs are the user’s emails. I am trying to read the data in one of the documents following the example provided by Firebase here I get two errors: First one is the use of “await”: Uncaught SyntaxError: