Skip to content
Advertisement

Tag: firebase

Is there a way to get all documents in a subcollection (Firestore)

I’m having difficulties querying all documents inside a subcollection in my Firestore database. (I am using Node.js) My goal is to get all the data from every document inside the subcollection named favorites My database structure looks like this. I looked at the documentation at https://firebase.google.com/docs/firestore/query-data/get-data but without any result how to solve the problem. My query looks like this

How to save date as Timestamp in firestore using firebase-admin?

Trying to convert from javascript date to firestore timestamp throws I tried it in 2 ways: Using firebase-admin Using firebase.firestore: date used as a param in new Date is of this format: “2017-01-29”. Expected result: firestore timestamp. Actual result: TypeError: Cannot read property ‘Timestamp’ of undefined Note: db nor firebase are null or undefined. Is there a definitive way of

Vuejs display result after completion of async request

I am displaying the name of the current user after querying it from the firestore database like so: then after fetching the result it should be something like below: However it does not display the name after the result is fetched immediately,since it takes some time. I am only able to show it after I change some property such as

Firebase how to break realtime database transaction with different state/message if different condition is true?

is it a good practice at all and if yes what is the correct way to break a transaction with different error states/messages for different situations? I have a transaction running over an ‘offer’ entry doing ‘seats’ reservation: I want to break it if one of the following 3 conditions is true and return state/message to the caller function. if

Advertisement