google-cloud-firestore

How to access query from itemBuilder?

江枫思渺然 提交于 2020-01-06 08:33:20
问题 I am make random chat app use FirestoreAnimatedList (FirebaseAnimatedList for Firestore). I want show user avatar only one time if same user send many message so not have same avatar show many time. My solution is use index for check if last message send by same user. So I need check like : if (snapshot[index - 1][‘user’] == user) { return true; } But my snapshot is DocumentSnapshot so cannot call [index - 1] . Maybe I must get list from query ? How to access so can call index on list and

retrieve values from firestore's struct in swift

限于喜欢 提交于 2020-01-06 08:32:13
问题 I'm querying some data from my firestore,and I put it in my Usersdata, but I dont know how to get my values from Usersdata. Please help me to query my data! This is my struct base on Firestroe example struct Usersdata { let uid:String? let facebook:String? let google:String? let name:String? let age:Int? let birthday:String? let smokeage:Int? let smokeaddiction:Int? let smokebrand:String? let gold:Int? let score:Int? let fish:Int? let shit:Int? let userimage:String? init?(dictionary: [String:

retrieve values from firestore's struct in swift

送分小仙女□ 提交于 2020-01-06 08:31:03
问题 I'm querying some data from my firestore,and I put it in my Usersdata, but I dont know how to get my values from Usersdata. Please help me to query my data! This is my struct base on Firestroe example struct Usersdata { let uid:String? let facebook:String? let google:String? let name:String? let age:Int? let birthday:String? let smokeage:Int? let smokeaddiction:Int? let smokebrand:String? let gold:Int? let score:Int? let fish:Int? let shit:Int? let userimage:String? init?(dictionary: [String:

Data is unknown / Cannot be fetched when link is clicked after implementing 'route-outlet'

孤街浪徒 提交于 2020-01-06 08:21:54
问题 I have this navbar, when I refresh the table, the data is fetched but when I move from links to links and go back to the link where the table is located. the data is not fetched or unknown. The problem occurs after I implemented the routers of the page. How can I fetch the data normally even I go back and forth with the links from the navbar. Im using firebase as my database here is the app-routing.module.ts import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '

Firestore order of writes

情到浓时终转凉″ 提交于 2020-01-06 08:04:14
问题 we've been using realtime database to save some data from mobile devices (ios, android + now web). I earlier asked if the order, in which other clients see the data, is guaranteed to be the same order in which client wrote those. (here Does Firebase guarantee that data set using updateValues or setValue is available in the backend as one atomic unit? , the title is a bit misleading, but the answer is there) The answer was yes, and now we're migrating to Firestore and I'm wondering if the same

Firestore order of writes

二次信任 提交于 2020-01-06 08:03:17
问题 we've been using realtime database to save some data from mobile devices (ios, android + now web). I earlier asked if the order, in which other clients see the data, is guaranteed to be the same order in which client wrote those. (here Does Firebase guarantee that data set using updateValues or setValue is available in the backend as one atomic unit? , the title is a bit misleading, but the answer is there) The answer was yes, and now we're migrating to Firestore and I'm wondering if the same

Javascript firebase firestore function not executing

烂漫一生 提交于 2020-01-06 08:02:53
问题 i try to build a ActionsOnGoogle App with the ActionsSDK, Firebase Functions and Firebase Firestore. I build a fulfillment that haves to intents. The mainIntent when starting the Actions App and the answerIntent when the users answers the question from the mainIntent. Getting the text in the mainIntent from the firestore database and ask the users with the wrapped text work very fine. But then inside the function where new data is wrapped from the database array get filled. After executing

firestore how to check if new documents added matching a particular query

自闭症网瘾萝莉.ら 提交于 2020-01-06 07:41:41
问题 As I know that, instead of get() I can use onSapshot() for my queries and listen to the changes(additions, deletions, modifications) for that query. But when there are changes, onSnaphot() returns multiple full documents whether modified, deleted or added (a new snapshot). What I want to do is, to check if new documents have been added matching my query and show a notification to the user that there are new records available, and only when a button is clicked, they should be able to fetch and

firestore how to check if new documents added matching a particular query

爷,独闯天下 提交于 2020-01-06 07:40:26
问题 As I know that, instead of get() I can use onSapshot() for my queries and listen to the changes(additions, deletions, modifications) for that query. But when there are changes, onSnaphot() returns multiple full documents whether modified, deleted or added (a new snapshot). What I want to do is, to check if new documents have been added matching my query and show a notification to the user that there are new records available, and only when a button is clicked, they should be able to fetch and

Using MediatorLiveData to merge to LiveData (Firestore) QuerySnapshot streams is producing weird results

半世苍凉 提交于 2020-01-06 07:25:47
问题 I'm assigning two Firestore Queries to LiveData objects. Each one of these queries returns to different object classes: User and Book. I need to merge both of them together and apply a transformation so I can create a LinkedHashmap that combines both sets of data (queries). In order to do this I'm using MediatorLive data and to be able to merge the two different classes I'm using QuerySnapshot as the return type. The problem I'm running into is when I output the results of the