google-cloud-firestore

Run a cron job only once after a set time

与世无争的帅哥 提交于 2020-06-26 07:44:12
问题 I need to run a cron job to perform a specific cloud function after a set interval only once but a bit unsure of how to do it. Is there any way to do this through the current google cloud platform? 回答1: Update following our discussion below through comments: If you want to "change a document in your Firestore database 2 hours after it has been created" you could do as follows: When creating the document in Firestore, save the date/time of creation, e.g. with firebase.firestore.FieldValue

Questions about firestore cache and reads charge

喜你入骨 提交于 2020-06-25 16:53:32
问题 There are my understand how firestore cache and read charge will behave in those scenarios.And I am not sure it's right or not. If I have 2000 documents in a collection.this collection name "testCollection".those documents won't change , update or delete. My client is android with already enable offline persistence and device is currently online 1. db.collection("testCollection").onSnapshot(function(doc) {}); 2000 reads charged and those document are cached. then reopen app and run same code

Cloud Functions ERROR: cannot convert an array value in an array value [closed]

て烟熏妆下的殇ゞ 提交于 2020-06-25 07:58:12
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . Improve this question I am trying to pass in this data into a field of a document using Cloud Functions: [ [ '-LXRXPFgA6sC9Mg0GQMt', 1, 'Sushi premium' ], [ '-LXRSAp3jpB8EUbZU-0c', 1, 'Caramel Glazed Donuts' ] ] The error I got is: Error: 3 INVALID_ARGUMENT: Cannot convert an array value in an array

Cloud Functions ERROR: cannot convert an array value in an array value [closed]

懵懂的女人 提交于 2020-06-25 07:57:15
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . Improve this question I am trying to pass in this data into a field of a document using Cloud Functions: [ [ '-LXRXPFgA6sC9Mg0GQMt', 1, 'Sushi premium' ], [ '-LXRSAp3jpB8EUbZU-0c', 1, 'Caramel Glazed Donuts' ] ] The error I got is: Error: 3 INVALID_ARGUMENT: Cannot convert an array value in an array

Display duplicate events after update firestore data, but the data itself in firestore isn't duplicated

旧街凉风 提交于 2020-06-25 07:32:07
问题 I have a web application(Angular) and mobile application(Ionic). Both of them share the same Firestore data. Use web application update existing data but the ionic app shows duplicate items(the duplicates will be gone after restart the mobile app), I check the item data itself in Firestore, it was updated and unique. Does anyone have any clue on this? This issue only occurs on the mobile app other than the web app, both of them use "angularfire2": "^5.0.0-rc.4", import { AngularFirestore,

Increment existing value in firebase firestore

限于喜欢 提交于 2020-06-25 04:56:41
问题 Is there any way to increment existing value in firestore ? What I am trying. FirebaseFirestore.getInstance() .collection("notifications") .document(response.getString("multicast_id")) .set(notificationData); FirebaseFirestore.getInstance() .collection("users") .document(post.userId) .get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() { @Override public void onComplete(@NonNull Task<DocumentSnapshot> task) { if (task.isSuccessful()) { int followers = Integer.valueOf(task

Convert FirestoreCollection into an array?

江枫思渺然 提交于 2020-06-25 00:58:48
问题 I'm having difficulty converting the Firestore data into an array for the chart.js graph. Getting the data from Firestore fetchData(){ //Get data this.updatesCollection = this.afs.collection(pathStats); this.updates = this.updatesCollection.valueChanges(); } Creating the Chart createChart(){ this.chart = new Chart('canvas', { type: 'line', data: { labels: ['5/18/18', '5/19/18', '5/20/18', '5/21/18', '5/22/18', '5/23/18'], datasets: [{ label: 'Filled', backgroundColor: 'gray', data: [4, 3, 5,

Convert FirestoreCollection into an array?

◇◆丶佛笑我妖孽 提交于 2020-06-25 00:58:40
问题 I'm having difficulty converting the Firestore data into an array for the chart.js graph. Getting the data from Firestore fetchData(){ //Get data this.updatesCollection = this.afs.collection(pathStats); this.updates = this.updatesCollection.valueChanges(); } Creating the Chart createChart(){ this.chart = new Chart('canvas', { type: 'line', data: { labels: ['5/18/18', '5/19/18', '5/20/18', '5/21/18', '5/22/18', '5/23/18'], datasets: [{ label: 'Filled', backgroundColor: 'gray', data: [4, 3, 5,

How to get an array from Firestore?

蓝咒 提交于 2020-06-24 20:52:49
问题 I have the above data structure stored in Cloud Firestore. I want to save the dungeon_group which is an array of strings stored in Firestore. I have difficulty in getting the data and stored as an array. I am just able to get a weird string but any method to store as a string array? Below is the code I used. I am able to achieve this in Swift as follow, but not sure how to do the same in Android. //Swift Firestore.firestore().collection("dungeon").document("room_en").getDocument { (document,

Error when connecting to firebase/firestore: Could not reach Cloud Firestore backend

为君一笑 提交于 2020-06-23 14:13:23
问题 I am developing an app in swift and using Firestore to store my data. It’s the first time that I am using Firebase. Yesterday I connected the firebase and firestore to my project and everything worked fine. Today suddenly I got an error that It could not connect to the Firestore backend. 2020-04-03 13:37:25.851931+0200 Bouwresten[14277:2448929] 6.21.0 - [Firebase/Firestore][I-FST000001] Could not reach Cloud Firestore backend. Connection failed 1 time. Most recent error: Network connectivity