google-cloud-firestore

How to load 2 different Firestore docs in one 'onUpdate' Cloud Function?

强颜欢笑 提交于 2020-01-16 14:03:25
问题 I am trying to make an "onUpdate" function that loads the document that has been updated. Then I want to load another document using the data received by the wildcards. So to summarize I want to access the document that was updated and one more that is in the same collection. I want : /userProfiles/{doc1}/employees/{doc2} AND /userProfiles/{doc1} . I can get them both but when I try to use the data from one, it doesn't read the previous data and gives me a ReferenceError . The end goal is to

Load Firestore data to Table view Swift 4

▼魔方 西西 提交于 2020-01-16 13:17:16
问题 I have a question related to load data from Firestore to table view. Basically, i understand how to do it, but in this case, i kind of confuse if the structure of Firestore as below: "fund" -> "randomId" -> "agensi: id" i was able to load the agensi from collection which is "WJ18kBvDLhVrvml2slXB". To get the real agensi name i have to get data from collection "Agensi" as image below: below is the code that what i have already did: var agencyname: [String] = [] func getData() { db.collection(

Loading images from Firestore into a RecyclerView when there are multiple image types

非 Y 不嫁゛ 提交于 2020-01-16 12:33:28
问题 I have a RecyclerView which uses a GridLayoutManager and each cell consists of a single ImageView. The data that i want to use to populate it are stored in my Firestore storage as .png and .jpeg images and the naming of each one is icon#.png or icon#.jpeg where # is the respective cell's position. My issue is that when i try to load each image into the respective cell's imageView with the way that you see below, i get an error message because i can't retrieve every image due to some having a

Loading images from Firestore into a RecyclerView when there are multiple image types

 ̄綄美尐妖づ 提交于 2020-01-16 12:33:28
问题 I have a RecyclerView which uses a GridLayoutManager and each cell consists of a single ImageView. The data that i want to use to populate it are stored in my Firestore storage as .png and .jpeg images and the naming of each one is icon#.png or icon#.jpeg where # is the respective cell's position. My issue is that when i try to load each image into the respective cell's imageView with the way that you see below, i get an error message because i can't retrieve every image due to some having a

Loading images from Firestore into a RecyclerView when there are multiple image types

ぐ巨炮叔叔 提交于 2020-01-16 12:33:06
问题 I have a RecyclerView which uses a GridLayoutManager and each cell consists of a single ImageView. The data that i want to use to populate it are stored in my Firestore storage as .png and .jpeg images and the naming of each one is icon#.png or icon#.jpeg where # is the respective cell's position. My issue is that when i try to load each image into the respective cell's imageView with the way that you see below, i get an error message because i can't retrieve every image due to some having a

whereArrayContains limit to 10

孤街醉人 提交于 2020-01-16 12:02:02
问题 I want to filter questionCollection on basis of tagIDs . Everything working fine but whereArraycontains is working for max 10 id's. How could I improve my structure to work for more than 10 tagIDs and also make sure to call as less as hit to server to reduce money spend . Firestore-root | --- questions (collection) | | | --- qid (documents) | | | --- title: "Question Title" | | | --- qid: "autogeneratedID" | | | --- tagIDs =[tagID_1,tagID_2...tag_IDs_5] // array | --- tags (collection) | | |

whereArrayContains limit to 10

蹲街弑〆低调 提交于 2020-01-16 11:58:31
问题 I want to filter questionCollection on basis of tagIDs . Everything working fine but whereArraycontains is working for max 10 id's. How could I improve my structure to work for more than 10 tagIDs and also make sure to call as less as hit to server to reduce money spend . Firestore-root | --- questions (collection) | | | --- qid (documents) | | | --- title: "Question Title" | | | --- qid: "autogeneratedID" | | | --- tagIDs =[tagID_1,tagID_2...tag_IDs_5] // array | --- tags (collection) | | |

How to display AngularFirestore data

早过忘川 提交于 2020-01-16 10:53:52
问题 I'm trying to display the username and age from my firestore database I get no errors but nothing is showing. What am I doing wrong here? home.ts import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams} from 'ionic-angular'; import { AngularFireAuth } from 'angularfire2/auth'; import { AngularFirestore} from 'angularfire2/firestore'; import { Profile } from './../../models/profile'; @IonicPage() @Component({ selector: 'page-home', templateUrl: 'home.html', })

How to display AngularFirestore data

拜拜、爱过 提交于 2020-01-16 10:53:06
问题 I'm trying to display the username and age from my firestore database I get no errors but nothing is showing. What am I doing wrong here? home.ts import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams} from 'ionic-angular'; import { AngularFireAuth } from 'angularfire2/auth'; import { AngularFirestore} from 'angularfire2/firestore'; import { Profile } from './../../models/profile'; @IonicPage() @Component({ selector: 'page-home', templateUrl: 'home.html', })

Is it possible to add only new documents to Cloud Firestore cache?

 ̄綄美尐妖づ 提交于 2020-01-16 10:30:28
问题 I have an app that has 50k - 60k document reads a day and I can't afford another plan now, so I'm looking for a way to optimize reads, getting less reads possible I can. The database has 4 collections with some subcollections, I think I might have around 1000 documents in the whole server. It is there anyway: I can read documents from cloud Firestore (first time the user opens the app) and store on the Firestore cache, after that, make the app only load data from Firestore cache, and if there