google-cloud-firestore

How to get the uid of the authenticated Firebase user in a Cloud Functions storage trigger

夙愿已清 提交于 2020-05-14 10:22:48
问题 Background: I'm using Firebase Cloud Functions, the new Firestore Database, and storage bucket with an Android client. What I want to accomplish: When a user uploads a picture to a storage bucket, I want to use cloud functions to get the file path/link to the image location in the storage bucket and store this string as a new document under a new collection called "pictures" under the currently logged in user's document in Firestore. That way, I can see the images each user has uploaded

When does it make sense to use Firebase realtime DB and Firestore together? [closed]

醉酒当歌 提交于 2020-05-14 09:13:31
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 20 days ago . Is there any situation where it makes sense to use both realtime and firestore in conjunction? What situations lend themselves more favorably to firebase realtime vs firestore, or a combination? I keep reading about horror stories of people getting hit with huge costs is there

when creating a server for generating Firebase CustomToken am I using only Service Accounts or somehow behind the scene also User Credentials?

大憨熊 提交于 2020-05-14 07:09:08
问题 The bounty expires in 5 days . Answers to this question are eligible for a +50 reputation bounty. Jim C is looking for an answer from a reputable source . We are moving soon this project to production. 1 - Our Mobile App will create money transfer by posting it to our internal microserve. Such post request will return a CustomToken generated from our internal NodeJs server. 2 - Our internal microservice will replicate such transfer to Firestore and update its state on Firestore accordingly. 3

See Array Changes in Firestore Security

筅森魡賤 提交于 2020-05-14 02:20:46
问题 I have a collection reviews where each review contains a list of uid s of users who have liked it called likes . The schema looks like: review (collection) title string author uid likes [ uid ] posted timestamp user (collection) - uid created timestamp email string Currently, I'm handling a user liking a review with: firebase.firestore().doc(rid).update({ likes: firebase.firestore.FieldValue.arrayUnion(this.fetchCurrentUID()) }); And unliking with: firebase.firestore().doc(rid).update({ likes

Firebase: Reduce number of reads for a large collection

被刻印的时光 ゝ 提交于 2020-05-14 01:21:44
问题 After a lot of searching, I've found a lot of "what not to do" when it comes to reading firebase collections (main example being the incident of the $30k bill), however I'm struggling to find a suitable solution for our problem. Our website contains a product catalogue. The catalogue is populated from a firestore collection called 'products', with the JSON structure as: "products"{ "productId"{ "name": "price": "brand": ... } } In order to load the collection, I use the following: this

Firebase: Reduce number of reads for a large collection

最后都变了- 提交于 2020-05-14 01:21:08
问题 After a lot of searching, I've found a lot of "what not to do" when it comes to reading firebase collections (main example being the incident of the $30k bill), however I'm struggling to find a suitable solution for our problem. Our website contains a product catalogue. The catalogue is populated from a firestore collection called 'products', with the JSON structure as: "products"{ "productId"{ "name": "price": "brand": ... } } In order to load the collection, I use the following: this

Firebase: Reduce number of reads for a large collection

你。 提交于 2020-05-14 01:19:05
问题 After a lot of searching, I've found a lot of "what not to do" when it comes to reading firebase collections (main example being the incident of the $30k bill), however I'm struggling to find a suitable solution for our problem. Our website contains a product catalogue. The catalogue is populated from a firestore collection called 'products', with the JSON structure as: "products"{ "productId"{ "name": "price": "brand": ... } } In order to load the collection, I use the following: this

Flutter Multiple Firestore Queries

心已入冬 提交于 2020-05-13 04:36:51
问题 I am trying to make multiple queries to Firestore and merge the results into one stream like here. I tried using StreamGroup.merge() but it's only returning the results of one stream. I noticed that it does actually get data for all the streams but only returns one when everything completes. Here is what I did: Stream getStream(){ List<Stream> streams = []; streams.add(Firestore.instance.collection(Constants.REQUESTS_NODE). where("municipality",isEqualTo: "City of Johannesburg Metropolitan").

Firestore pricing clarifications for offline cached data

好久不见. 提交于 2020-05-12 16:52:52
问题 It seems odd to me that Firestore would charge me for read queries to locally cached data, but I can't find any clarification to the contrary in the Firestore Pricing document. If I force Firebase into offline mode and then perform reads on my locally cached data, am I still charged for each individual entity that I retrieve? Second, offline users in my app write many small updates to a single entity. I want the changes to persist locally each time (in case they quit the app), but I only need

Firestore pricing clarifications for offline cached data

醉酒当歌 提交于 2020-05-12 16:51:48
问题 It seems odd to me that Firestore would charge me for read queries to locally cached data, but I can't find any clarification to the contrary in the Firestore Pricing document. If I force Firebase into offline mode and then perform reads on my locally cached data, am I still charged for each individual entity that I retrieve? Second, offline users in my app write many small updates to a single entity. I want the changes to persist locally each time (in case they quit the app), but I only need