google-cloud-firestore

How to Get Real time Updates From Firebase In Firebase

[亡魂溺海] 提交于 2020-06-29 03:47:41
问题 I've been trying to get Firebase to work real time and i have a couple of issues. What i want to achieve is to be able to tell when a new document is added to a collection, just that, nothing more. What seems to be happening is my code always returns all the documents in the collection. Below is my code: listenNewPost(int categoryId, Users user, Function(DocumentSnapshot) onData) async { var ref = this._firestore.collection('posts').reference(); var query = ref.orderBy('created_at',

Firestore won't add signup email to new database collection

家住魔仙堡 提交于 2020-06-29 03:39:26
问题 When signing up a user, I get no error what so ever, the signup works, but it doesn't create a new DB collection with the signup email. Furthermore, redirecting the user to /account/dashboard.html doesn't work. Any ideas? I am very new to all of this, only 4 days in so if you could please explain things a little simpler to me that would be very much appreciated. // sign up the user firebase.auth().createUserWithEmailAndPassword(email, password).then(cred => { return db.collection('users').doc

Unable to add Google markers inside a loop

ε祈祈猫儿з 提交于 2020-06-29 03:38:10
问题 So, I'm getting addresses from my firestore database, converting them to coordinates, then trying to add markers based on each set of coordinates. I'm able to add markers outside the loop, but not inside. Thank you //Convert addresses to coords //Fetch all addresses from db db.collection('specials').get() .then(snapshot => { snapshot.forEach(special => { //Set location var location = special.data().address; //Get geocode info axios.get('https://maps.googleapis.com/maps/api/geocode/json

Efficiently search/exist() Firestore without exhausting free quota

跟風遠走 提交于 2020-06-29 03:37:32
问题 I'm working on a side project and want to let my users check if their friends have accounts. Currently I've implemented it like this: Read phone contacts for emails Loop through the emails Make .get() query on the user database 1 for users with that email If data comes back, the friend is on the platform and an invite button is displayed Free quota 2 exceeded within an hour The thing is that any .get is considered a read operation, even if no data comes back. Their doc.exists can only be tun

How to do integration tests for Firebase HTTP functions with Firestore

你。 提交于 2020-06-28 07:55:39
问题 Trying to write integrations tests for HTTPS function (implemented as an express app) that use Firestore as DB Since its an integration test, I don't want to mock the Firestore DB in this case, however, since they perform network calls, they take time to execute Is there a Firestore local emulator to use in this scenario? There is an option to config Firestore in offline mode, maybe that's the way? Didn't find any documentation in Firebase on this use case AskFirebase 回答1: You have to setup a

Firebase always reads from internet

心不动则不痛 提交于 2020-06-28 05:59:23
问题 As I know Firebase on Flutter will automatically read from cache first but I noticed while development that an app just play around with almost 1 stream that has 10 or 15 document I have reach reads above 4000 reads! By this way if 10 users has used my app I will pay all I have, so I have recheck every query, snapshot and put this code to know print(itemDoc.metadata.isFromCache ? "itemDoc NOT FROM NETWORK" : "itemDoc FROM NETWORK"); Edit write the code and more explain I noticed this issue

java.lang.RuntimeException: Internal error in Firestore (0.6.6-dev)

点点圈 提交于 2020-06-28 03:48:09
问题 I am using FireStore in my application. and their version is implementation 'com.google.firebase:firebase-firestore:17.0.1' I am using database of Firestore and offline feature of firestore to get data. this is working fine but when i sign the application that time i am getting below bug. E/AndroidRuntime: FATAL EXCEPTION: main Process: com.firestoretest.videostatus, PID: 13763 java.lang.RuntimeException: Internal error in Firestore (0.6.6-dev). at bov.b(Unknown Source:19) at box.run(Unknown

How to set data to a Array with objects in Firestore

我的梦境 提交于 2020-06-27 17:35:29
问题 What I want to do is to set all data to my array in Firestore, it would look something like this: Firestore But what I have done gives me this error: *** Terminating app due to uncaught exception 'FIRInvalidArgumentException', reason: 'Unsupported type: _SwiftValue' *** First throw call stack: ( 0 CoreFoundation 0x000000010b8d71e6 __exceptionPreprocess + 294 1 libobjc.A.dylib 0x000000010af6c031 objc_exception_throw + 48 2 test collectionview 0x00000001092e7dda -[FSTUserDataConverter

Firestore security rules: Using hasOnly on a request to check if only a specific field is updated

岁酱吖の 提交于 2020-06-26 12:07:40
问题 I'm setting up my Firestore security rules, but run against one issue wherein I want to limit updating only one specific field within a document by using the hasOnly function. The problem is that I keep getting 'denied' results using the simulator. I'm surely doing something simple wrong... I'm trying to prevent that somebody could update other fields in the document than update_requested_time , but allow them to update this particular field. When using the example from the Firestore

Firestore security rules: Using hasOnly on a request to check if only a specific field is updated

泪湿孤枕 提交于 2020-06-26 12:06:50
问题 I'm setting up my Firestore security rules, but run against one issue wherein I want to limit updating only one specific field within a document by using the hasOnly function. The problem is that I keep getting 'denied' results using the simulator. I'm surely doing something simple wrong... I'm trying to prevent that somebody could update other fields in the document than update_requested_time , but allow them to update this particular field. When using the example from the Firestore