google-cloud-functions

How to iterate through a Firestore snapshot documents while awaiting

北城以北 提交于 2021-01-07 04:01:13
问题 I have been trying to obtain a series of documents from firestore, reading them and acting accordingly depending on a series of fields. The key part is I want to wait for a certain process while working on each document. The official documentation presents this solution: const docs = await firestore.collection(...).where(...).where(...).get() docs.forEach(await (doc) => { //something }) The problem with this solution is taht when you have a promise inside the forEach it won't await it before

Get map of map field from Firestore

断了今生、忘了曾经 提交于 2021-01-07 03:16:23
问题 I have a field of type map that contains Maps of data in firestore. I am trying to retrieve this data using a cloud function in node.js. I can get the document and the data from the field but i can't get it in a usable way. I have tried every solution i can find on SO and google but the below is the only code that can give me access to the data. I obviously need to be able to access each field with in the Map individually. in swift i build an array of String:Any but i can get that to work in

Get map of map field from Firestore

孤街浪徒 提交于 2021-01-07 03:15:16
问题 I have a field of type map that contains Maps of data in firestore. I am trying to retrieve this data using a cloud function in node.js. I can get the document and the data from the field but i can't get it in a usable way. I have tried every solution i can find on SO and google but the below is the only code that can give me access to the data. I obviously need to be able to access each field with in the Map individually. in swift i build an array of String:Any but i can get that to work in

Firebase functions return 404

我的未来我决定 提交于 2021-01-07 03:13:33
问题 I am trying to set up a custom domain for firebase functions. Custom domain already verified and works fine. My firebase functions run under us-central1 : here is my code for login function: const functions = require("firebase-functions"); const express = require(`express`); const cors = require(`cors`); const admin = require(`firebase-admin`); admin.initializeApp(); const firestore = admin.firestore(); const appLogin = express(); appLogin.use(cors({origin:true})); appLogin.post("/", async

Firebase functions return 404

可紊 提交于 2021-01-07 03:13:20
问题 I am trying to set up a custom domain for firebase functions. Custom domain already verified and works fine. My firebase functions run under us-central1 : here is my code for login function: const functions = require("firebase-functions"); const express = require(`express`); const cors = require(`cors`); const admin = require(`firebase-admin`); admin.initializeApp(); const firestore = admin.firestore(); const appLogin = express(); appLogin.use(cors({origin:true})); appLogin.post("/", async

Generating Cloud Storage Signed URL from Google Cloud Function without using explicit key file

試著忘記壹切 提交于 2021-01-07 01:41:38
问题 I'd like to create a pre-signed upload URL to a storage bucket, and would like to avoid an explicit reference to a json key. Currently, I'm attempting to do this with the Default App Engine Service Account I'm attempting to follow along with this answer but am getting this error: AttributeError: you need a private key to sign credentials.the credentials you are currently using <class 'google.auth.compute_engine.credentials.Credentials'> just contains a token. see https://googleapis.dev/python

Generating Cloud Storage Signed URL from Google Cloud Function without using explicit key file

北战南征 提交于 2021-01-07 01:37:49
问题 I'd like to create a pre-signed upload URL to a storage bucket, and would like to avoid an explicit reference to a json key. Currently, I'm attempting to do this with the Default App Engine Service Account I'm attempting to follow along with this answer but am getting this error: AttributeError: you need a private key to sign credentials.the credentials you are currently using <class 'google.auth.compute_engine.credentials.Credentials'> just contains a token. see https://googleapis.dev/python

Firebase CLI deploy error: “Deploys to runtimes below Node.js 10 are now disabled in the Firebase CLI.”

邮差的信 提交于 2021-01-03 03:15:18
问题 I have a project using Cloud Functions for Firebase, and after updating the Firebase CLI to version 9.0.0, I am getting an error message: Error: package.json in functions directory has an engines field which is unsupported. Valid choices are: {"node": "10"}, {"node":"12"}, and {"node":"14"}. Deploys to runtimes below Node.js 10 are now disabled in the Firebase CLI. Existing Node.js 8 functions will stop executing on 2021-03-15. Update existing functions to Node.js 10 or greater as soon as

Firebase CLI deploy error: “Deploys to runtimes below Node.js 10 are now disabled in the Firebase CLI.”

霸气de小男生 提交于 2021-01-03 03:15:03
问题 I have a project using Cloud Functions for Firebase, and after updating the Firebase CLI to version 9.0.0, I am getting an error message: Error: package.json in functions directory has an engines field which is unsupported. Valid choices are: {"node": "10"}, {"node":"12"}, and {"node":"14"}. Deploys to runtimes below Node.js 10 are now disabled in the Firebase CLI. Existing Node.js 8 functions will stop executing on 2021-03-15. Update existing functions to Node.js 10 or greater as soon as

Firebase CLI deploy error: “Deploys to runtimes below Node.js 10 are now disabled in the Firebase CLI.”

雨燕双飞 提交于 2021-01-03 03:13:44
问题 I have a project using Cloud Functions for Firebase, and after updating the Firebase CLI to version 9.0.0, I am getting an error message: Error: package.json in functions directory has an engines field which is unsupported. Valid choices are: {"node": "10"}, {"node":"12"}, and {"node":"14"}. Deploys to runtimes below Node.js 10 are now disabled in the Firebase CLI. Existing Node.js 8 functions will stop executing on 2021-03-15. Update existing functions to Node.js 10 or greater as soon as