I know how to count how many Documents are in a collection in Firebase but how does it work the other way around. I have several collections in a document and I need to find out how many. (In my example it would be 2) My Setup: I tried the following but it does not work: Does anybody know how
Tag: firebase
How to redirect the user to another page after successfully signing in or signing up in HTML?
I’m looking to redirect the user to another page after successfully signing in or signing up in HTML and Firebase. I have login.html and signup.html as well as home.html inside the home folder. After successfully signing in or signing up, I need to redirect the user to home.html as well as prevent the user from returning to login.html or signup.html.
How to access field on an array in cloud function?
I have this cloud function that creates a new document every time I have a new chat. I am trying to access the values on the messages array, but I got undefined on the console log. here is my document on firebase: I am trying to access the messages with lastMessage = data.messages to create a new document with these
React Native Firebase Array Query to do ArrayContains with AND operation
I have group collection. In each group document, I store which users are associated with the group via members array field in firebase. Eg: user1 & user2 are in xyz(id) group and I would like to query from client to get all the group where having user1 & user2 ( not OR ). I have tried firebase IN array query
Firebase authentication in ReactJS project – user null inside onAuthStateChanged
I’m tearing my hair out trying to setup email/password authentication through firebase. I’ve got my firebase configuration setup like so I’ve got a sign-in form created that calls the following function: First problem: I’m not seeing the “user created” message, even though I can see the user being created in the Firebase Authentication console. I’m also not seeing the “something
How can I display all data from Firestore documents into an html table
I am designing a web page that will obtain data from my firestore collection and display each document with its corresponding fields Here is the code: here is the JS: Answer I don’t see why you’re using a for loop in your function. Unless one “Book” document is an Array of items each having the Title/Author/Points fields. You’re basically looping
Firebase extract name of object
I have a simple question today. I retrieve data from my firebase database: Also I log the results in the console, the following text is what I retrieve: Now my question: I want to access not the id that is in the objects but rather the “name” of the object itself. If you look at the first element: “-MPOg49jvG-md0twgj-D”: Object
Vuex Store Object Child returns undefined, parent returns properly. Why?
I’ve seen some similar questions but they don’t seem to match my situation. When I log this.$store.state.account I get the expected result However, when I console.log(this.$store.state.account.user) the user object disappears! All of the nested properties inside user return undefined though they log perfectly fine above console.log(this.$store.state.account.user) This is the method inside my component calling the object this is the action
What’s the difference with linkWithCredential and linkWithPopup
I read the Convert an anonymous account to a permanent account and see that using the: will merge the anonymous and e.g., Google, Facebook etc.. credential Then I read Link Multiple Auth Providers to an Account Using JavaScript will do the same using the: What is the difference and which should I use if my SPA Reactjs app require anonymous
Firestore FieldValue.increment()
I’m trying to use firebase.firestore.FieldValue.increment(), but FieldValue.increment() method is not available. I have attached an image contain available methods for firestore. This is my import: Please assist, maybe I am missing something here. Firestore Documentation Image of firebase.firestore.methods() EDIT 2: Below is the Firebase config import I did tried Doug’s export and it worked, but I’m wondering why after calling