google-cloud-firestore

Firestore — Get only the changed documents in a large synced collection

☆樱花仙子☆ 提交于 2020-06-22 04:25:02
问题 I've read all of the questions below, and cannot find anything in the docs to describe how to sync a collection and receive only changed documents from a collection. I've got over 500 documents in my synced collection (using redux-saga-firebase syncCollection) but usually only about 100 of them ever change. At any given time, even fewer will change, but I'm currently getting all 500+ documents back when even one changes, which results in 500+ reads. Not ideal, and will cost me at scale. Here

Why 1 document write in Firestore costs +30 reads? [duplicate]

徘徊边缘 提交于 2020-06-21 05:44:52
问题 This question already has an answer here : Firestore - unexpected reads (1 answer) Closed 14 days ago . I am using Firebase Firestore to create a log system. The structure is: collection: errors entry for error 1 entry for error 2 ... I add an error like so: val error = hashMapOf( "datetime" to FieldValue.serverTimestamp(), "errorMessage" to errorMessage ) database.collection("errors") .add(error) Then I watch at how the costs are affected by this operation. Regarding the write count, it

firestore.where() on two fields at once

点点圈 提交于 2020-06-21 05:37:45
问题 I have a firestore collection of the following documents: [ { start: { geohash: 'u3qchtmpuy2d' }, destination: { geohash: 'u3qcjvxfh9cs' }, timestamp: '28 June 2019 at 20:24:00 UTC+2', ... } ] and I tried to query it like this (its Firestore Web SDK) // 5-characters geohash is 4.89km × 4.89km const start = 'u3qch'; const destination = 'u3qcj'; const timestamps = { min: firestore.Timestamp.fromDate( moment(someDateTime).subtract(10, 'minutes').toDate() ), max: firestore.Timestamp.fromDate(

firestore.where() on two fields at once

霸气de小男生 提交于 2020-06-21 05:37:41
问题 I have a firestore collection of the following documents: [ { start: { geohash: 'u3qchtmpuy2d' }, destination: { geohash: 'u3qcjvxfh9cs' }, timestamp: '28 June 2019 at 20:24:00 UTC+2', ... } ] and I tried to query it like this (its Firestore Web SDK) // 5-characters geohash is 4.89km × 4.89km const start = 'u3qch'; const destination = 'u3qcj'; const timestamps = { min: firestore.Timestamp.fromDate( moment(someDateTime).subtract(10, 'minutes').toDate() ), max: firestore.Timestamp.fromDate(

Plugin project :firebase_core_web not found

折月煮酒 提交于 2020-06-20 15:33:46
问题 I try to connect Android project to Firebase but I get this error as I added the following to pubsec.yaml: firebase_auth: ^0.16.0 cloud_firestore: ^0.13.5 when I gradle run and it is not working Plugin project :firebase_core_web not found. Please update settings.gradle. Plugin project :firebase_auth_web not found. Please update settings.gradle. Plugin project :cloud_firestore_web not found. Please update settings.gradle. Is there any solution for it 回答1: In your android/app/build.gradle ,

Firestore: List subcollections of a document using python

ぐ巨炮叔叔 提交于 2020-06-17 22:52:51
问题 Is it possible list subcollections of a document using python? It seems that google documentation is discordant Here they say that get collections method is not available in the Python client library: https://firebase.google.com/docs/firestore/query-data/get-data#python_6 Here they say that class collections() list subcollections: https://googleapis.dev/python/firestore/latest/document.html So I try something like: collnameref = db.collection(collname) docs = collnameref.stream() for doc in

Cloud firestore rules using exist() does it count as a read?

回眸只為那壹抹淺笑 提交于 2020-06-17 16:20:40
问题 I am storing a collection of documents of blocked users. I am checking if the request is from a blocked user or not by checking if the email exist within the blocked collection allow read: if exists(/databases/$(database)/documents/blocked/$(request.auth.token.email)) == false; does checking if the document exist count as a read? 回答1: Yes, exists() counts as a read toward your billing. They also count against the max number of reads you can perform per request. 来源: https://stackoverflow.com

Firebase Cloud Functions Tokens

那年仲夏 提交于 2020-06-17 15:34:50
问题 I need help. Cloud functions written in node.js are throwing errors and not causing push notifications (alerter) to alert in my Android java app that a comment has been made or that a user has liked a post. On Firebase Console, I was able to get the error message in cloud functions log: Successfully sent message: { results: [ { error: [Object] } ], canonicalRegistrationTokenCount: 0, failureCount: 1, successCount: 0, multicastId: 7952971403531609000 } When I view the error message on Firebase

StreamProvider works correctly, however on stream update child widgets don't rebuild. UI not updating

拜拜、爱过 提交于 2020-06-17 15:11:49
问题 I'm using a StreamProvider in flutter to listen to my firebase collection. The stream works correctly however since I'm passing down the value of the stream provider to other child widgets(all of which are stateless) the child widgets don't rebuild even though the stream is correctly updated. This is my stream provider StreamProvider<List>.value( value: ChatService(shadeUID: widget.poll.shadeUID, pollUID: widget.poll.uid).threads, child: ThreadsList(poll: widget.poll, shadowUID: widget

StreamProvider works correctly, however on stream update child widgets don't rebuild. UI not updating

烈酒焚心 提交于 2020-06-17 15:11:45
问题 I'm using a StreamProvider in flutter to listen to my firebase collection. The stream works correctly however since I'm passing down the value of the stream provider to other child widgets(all of which are stateless) the child widgets don't rebuild even though the stream is correctly updated. This is my stream provider StreamProvider<List>.value( value: ChatService(shadeUID: widget.poll.shadeUID, pollUID: widget.poll.uid).threads, child: ThreadsList(poll: widget.poll, shadowUID: widget