I am having trouble deleting on firestore here’s my delete but everytime i try to delete nothing happens . There’s no error at all . this is how I set that collection Answer If you want to delete all the docs of the messages (sub)collection, you need to query the collection and delete each document, for example by using Promise.all()
Tag: firebase
What is the typeof of a QuerySnapshot?
With firebase, you can get documents in a collection like this: const collectionData = await collectionPath.get(); using collectionData, you can loop with: The above code makes collectionData behave like an array of documents. However, you can still treat it like an object by calling things like size? e.g collectionData.size will return the size of items in there. My question is,
Is there a way to get all data from a firestore database using useCollectionData()?
I have a React project and in it I have the following code: (using this react hook for firebase) Instead of this, I don’t want the query to be ordered or have a limit, is there a way to make an “empty” query to get all the data from a certain collection? Answer If you pass messagesRef instead of a
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 Firestore db.collection is not a function
I am developing a shift scheduler and I use firebase authentication and firestore. My idea is that when a user signs up it creates a document in collection “workers” and sets the doc id to the user’s email. When the user adds a shift I want to add the shift info into a sub-collection “shifts” inside that user’s document where
TypeError: firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__.default.firestore is not a function
Just trying to set it up firebase for the first time and I get these errors cant find any right answer to work this is my config the error I get – TypeError: firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__.default.firestore is not a function it shows to the line const db = firebase.firestore(); Answer If you want to use the compat version of firestore you need
Firebase v9 ,Cannot get document from a nested collection
I feel like it was easier to get subcollection in v8 ,It’s been like 2 days trying to do it the new way but I gave up. Im building a simple react social media app for learning purposes. where each user logs in and be able to post some text (and images but not atm), I have a main collection
TypeError: undefined is not an object(evaluating ‘_$$_REQUIRE(_dependencyMap[9], “../../config/FIREBASE”).FIREBASE.database’)
I have installed Firebase with npm in Firebase, but I don’t know what happens with this error. File FIREBASE.js TambahKontak.js Answer You aren’t using the new Modular/Functional syntax which is included from version 9.0.0+. You would have to rewrite your code to follow the new syntax: If you want to use the existing code (with older syntax) then use compat
How do I delete a list item that has been given a unique id when created, in React + Firebase?
I am creating a Todo list using React and Firebase. So far, I have already created the AddToDo functionality, however, now I am having trouble with the delete functionality. I believe this is where my problem lies. For example, when I try and click the delete icon that I set up, I get an error: This is the code if
Users duplicate on Firestore when I use googleSignIn
I have two ways to register a user in Firebase: through email and through Google Sign In. I perform the user registration by email as follows: In other words, in addition to saving the user in Firebase Authentication, I also send their name and email to Firestore. And this is my first question: Is it the most effective way to