我正在尝试部署一个云功能,该功能将在将文档添加到特定集合时触发,如下所示:
const admin = require("firebase-admin");
const functions = require("firebase-functions");
const Firestore = require("@google-cloud/firestore");
const firestore = new Firestore({ projectId: config.projectId });
admin.initializeApp(config);
exports.checkCapacity = functions.firestore.document("gran_canaria/las_palmas_1/miller_pendientes/{albnum}")
.onCreate(async (snapshot, context) => {});
但是,这会引发部署失败错误:
未能配置触发器提供程序/cloud.firestore/eventTypes/document.create@firestore.googleapis.com ( gcf .us-central1.checkCapacity)
如果我删除通配符并将引用更改为:
"gran_canaria/las_palmas_1/miller_pendientes/albnum"
我尝试将方法更改为 onWrite(),删除并重新部署该函数并在https://status.cloud.google.com/检查云状态,但找不到任何解决方案。
