google-cloud-firestore

scope issue in javascript between two Functions

寵の児 提交于 2021-02-08 06:33:08
问题 i have try to get the excel sheet using xlsx-populate so i am trying to get the values from mailEvents collections so i can add or pass the value in the init Collection function.if i have solved this issue then my problem regarding excel is also solved. in this problem i want to access the topHeader var in init collection. here in arr2 there is the values in this form ['open','processed'] const completeReport = (startTime,endTime) => { serverRef = db.collection("MailEvents"); let getDocs =

Firestore pricing; need help understanding a phrase in the document

冷暖自知 提交于 2021-02-08 06:13:16
问题 I came across the phrase below in Firestore help document which got me confused. "Also, if the listener is disconnected for more than 30 minutes (for example, if the user goes offline), you will be charged for reads as if you had issued a brand-new query." Does this mean that if I disconnect a listener and connect again within 30 minutes, I won't be charged for reads after connecting listener again? Imagine if I reconnect query and retrieve 20 documents again in (change.type === "added"). db

Firestore pricing; need help understanding a phrase in the document

孤人 提交于 2021-02-08 06:12:12
问题 I came across the phrase below in Firestore help document which got me confused. "Also, if the listener is disconnected for more than 30 minutes (for example, if the user goes offline), you will be charged for reads as if you had issued a brand-new query." Does this mean that if I disconnect a listener and connect again within 30 minutes, I won't be charged for reads after connecting listener again? Imagine if I reconnect query and retrieve 20 documents again in (change.type === "added"). db

Impossible to set the Cloud Firebase daily spending limit

怎甘沉沦 提交于 2021-02-08 05:55:52
问题 I just purchased a Firebase blaze plan (unlimited) but I tried to setup the daily quota as suggested in their documentation: https://firebase.google.com/docs/firestore/quotas#set_spending_limits The problem is that I can't find this option on my own console, there is no "Set budget" section: I really need to setup this daily alert to avoid any bad surprises. Why am I not seeing this option? Thanks 回答1: Well it seems they removed the possibility... The documentation page (https://firebase

Administrator Views for a Firebase Web Application: How To

纵饮孤独 提交于 2021-02-08 05:21:13
问题 My Firebase web app requires administrator access, i.e., the UI should show a few things only for admins (an 'administrator' section). I came up with the below as a means to authorize the UI to display the admin section for valid admins only. My question is, good or bad? Is this a sound means of authorizing? ...so many ways to do this. This particular way requires me to configure admins in the security rules (vs in a node/tree in a db/firestore) My idea is that if the .get() fails due to

How to turn Firestore query into a Javascript array

Deadly 提交于 2021-02-08 05:16:30
问题 I am trying to export a firestore function that performs a query and returns an array containing the objects in that query. I am trying to get data from a subcollection of a document, and get an array of document objects returned to render to the client. I've tried the below but it's not working (e.g. the object returns blank). I think this has to do with improper handling of promises, but couldn't figure it out on my own. Thanks for your help. export const getEvents = (id) => { let events =

Is it safe to store small images in Firestore?

ⅰ亾dé卋堺 提交于 2021-02-08 04:21:38
问题 I have a Firebase database and now I'm moving to Firestore. Are there any problems if I store small images in Firestore that are encoded to Base64? I have a collection sport_products where I have documents with all details and I also have an icon with the corresponding brand and I want to store all data + icon in a single place. Is it safe? 回答1: You don't need to base64 encode anything in Firestore. It has a native binary field type called "bytes". base64 will just make the data larger for no

Count unseen messages in group chat with firestore

余生长醉 提交于 2021-02-08 03:31:31
问题 I want to track the number of unseen messages for each member of a group chat. I store chat metadata in a chats collection, and messages for each chat in messages/{chatId} . I have checked other threads that ask about this, but in this scenario there's a group chat so it's more complicated. The threads that I have read suppose that it's a chat between two people. I have thought about having a new collection seenMsgTimestamps where I store the timestamp of the last message that a certain user

How can I update map data that's in a array in firebase? (Flutter)

↘锁芯ラ 提交于 2021-02-08 03:06:28
问题 I'm using flutter web and firebase for a project and got stuck on a problem. I'm trying to update a map in an array in firestore. using this: var val = []; val.add({'groupUID': groupUID, 'inviteStatus': status}); var userInviteUID; await users .document(uid) .get() .then((value) => userInviteUID = value.data['inviteUID']); await invites .document(userInviteUID) .updateData({'invites': FieldValue.arrayUnion(val)}); I got this result: firestore structure What I want to do is just change the 1

How can I update map data that's in a array in firebase? (Flutter)

邮差的信 提交于 2021-02-08 03:00:11
问题 I'm using flutter web and firebase for a project and got stuck on a problem. I'm trying to update a map in an array in firestore. using this: var val = []; val.add({'groupUID': groupUID, 'inviteStatus': status}); var userInviteUID; await users .document(uid) .get() .then((value) => userInviteUID = value.data['inviteUID']); await invites .document(userInviteUID) .updateData({'invites': FieldValue.arrayUnion(val)}); I got this result: firestore structure What I want to do is just change the 1