google-cloud-firestore

Missing or insufficient permissions during post a document to Firestore using Custom Token

别说谁变了你拦得住时间么 提交于 2020-06-09 05:40:10
问题 Final Goal: my company will start use Firestore to update transaction status to our Mobile Application and Angular 9 frontend. Immediate challenge: learn how use Custom Token. Current issue: I get this erro although it is owner: "error": { "code": 403, "message": "Missing or insufficient permissions.", "status": "PERMISSION_DENIED" } I can't understand why getting PERMISSION_DENIED if the idToken is related to the Collection Owner. IAM Admin showing the user is owner: Steps to reproduce: 1 -

Convert date object from Google sheets (javaScript) to Firebase time stamp using AppScript

时光总嘲笑我的痴心妄想 提交于 2020-06-09 05:20:04
问题 I've got a date object in Google Sheet which I want to import to firestore as a timestamp object, but it doesn't work when I do it directly.I am using JavaSript in the Appscript. This stores an empty map in firestore: data.date = new Date(); What should I do to convert the date object to timestamp. This is my full code function uploadData() { var firestore = FirestoreApp.getFirestore (email, key, projectId); var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheetname = "Sheet1"; var sheet =

Document Updates - Do updates with no changes still cost 1 write?

佐手、 提交于 2020-06-08 13:19:05
问题 Do document updates, where the update from a client, has no difference with the Firestore server copy still cost in terms of number of writes? Also would a cloud function that is listening for updates also be invoked? 回答1: According to the Cloud Firestore Pricing documentation, each set() or update() operation will count as a write. In this case, you will still be charged with the cost of 1 write when called with new changes or not. 回答2: Document updates all incur billing for a write. But

@firebase/firestore: Firestore (5.0.4): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds

£可爱£侵袭症+ 提交于 2020-06-07 21:32:47
问题 I am working on an Angular 6 project. This is the error I get when I build with --prod flag, host and run. I've been sitting on this for a long time. Initially thought it was probably a problem with the firestore package and i waited. But now updated to firestore 5.0.4, the problem still exists. [2018-06-04T06:11:47.859Z] @firebase/firestore: Firestore (5.0.4): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds. This typically indicates that your device does not

Firestore limit reads and writes per hour or per day to prevent user setting a timer in the inspector

风格不统一 提交于 2020-06-06 07:57:28
问题 I am learning Firebase and I might use it in production. I can not find how to prevent a logged in user to edit javascript code and trigger thousands of reads per day automatically and that I will have to pay for. As far as I know, any user who would like to increase my firebase bill could set a timer by editing javascript code and read and write every 4 seconds where he can in the firestore database. How can you prevent a user read rate per day or hour? 回答1: There is no way to set a read

type 'Future<dynamic>' is not a subtype of type 'List<Profile>

百般思念 提交于 2020-06-01 05:50:53
问题 class Profile { final List<String> photos; final String name; final int age; final String education; final String bio; final int distance; Profile({ this.photos, this.name, this.age, this.education, this.bio, this.distance }); } class _MainControllerState extends State<MainController> { static List<Profile> demoProfiles = fetchData(); static fetchData() async{ final db = await Firestore.instance; List<Profile> list = []; db.collection("users").getDocuments().then((querySnapshot){

How to read data only from cache in Firestore?

跟風遠走 提交于 2020-06-01 05:50:30
问题 I read some answers here on stackoverflow, were is said that every time we get documents from Firestore, the SDK is always trying to get the online version of the documents, even if no documents were changed. This is ending in having more reads billed, which in my opinion is not necessary, since nothing is changed. What I want to achieve Let's say a have a collection of 5 documents. When the user opens the app for the first, I want to pay 5 reads. However, when the user opens the app for the

set in firestore the new displayName updated with Angular

跟風遠走 提交于 2020-06-01 05:50:07
问题 Hola developers being on this app with angular and firebase i already update my display name for user created , but now trying to keep that name in my firestore im having some issues. Service class where in i access my firstore and my fireauth modules export class LoginService { constructor( private userLogin: AngularFireAuth, private docCreator: AngularFirestore ) {} signUpUser(emailUser: string, passwordUser: string) { return new Promise((response, reject) => { this.userLogin

Use Firebase class in init() of other class

∥☆過路亽.° 提交于 2020-06-01 05:10:22
问题 I have a class, called UserData, which is set as an EnvironmentObject that collects the current user's data from Firestore and saves it in a public var. Now, to order, I want to load the items which each merchant has to offer, but for that I have to retrieve which merchant my user chose from the Firestore database. I called the UserData class in my readDrinksFromDb class, but in my init() function, where I load the merchant's items, the UserData just does not show any value and is just empty,

Updating a field inside a firebase firestore doc without hand write the field key to update Angular

半城伤御伤魂 提交于 2020-06-01 05:08:36
问题 How could i update a doc inside my firestore without precisely write in the code the field i want to update , cause already is reached through the form: .Lets say the HTML tag in Angular already brings both the key and the import(that one to be updated): HTML Tags <form [formGroup]="importNgForm" (submit)="addUniqueImport()"> <div class="modal-body"> <div class="form-group"> <label for="key"></label> <input disabled type="text" value='{{incomeSelected}}' name="key" class="form-control"