【发布时间】:2019-09-09 20:28:40
【问题描述】:
我需要创建一个 firebase 云函数,每次我将文档添加到集合时都会触发该函数。这个函数:
exports.sendEmailConfirmation = functions.firestore.document('multies/{id}/tenties/{id}').onCreate((snap, context) => {
// Get an object representing the document
//...
return transporter.sendMail(mailOptions).catch((err) => {
console.error(err);
return {
error: err
}
});
});
我在控制台中收到以下错误:
functions[sendEmailConfirmation(us-central1)]:部署错误。 未能配置触发器提供程序/cloud.firestore/eventTypes/document.create@firestore.googleapis.com (gcf.us-central1.sendEmailApplicationConfirmation)
在 Firestore 数据库中,我有一个包含多个文档的集合“multies”,而 foreach 文档我有一个也可以包含多个文档的“tenties”集合。每次我们在“multies”集合中的任何文档中将文档添加到“tenties”集合时,我的函数都应该触发。
我可以就如何配置路径或我在这里遇到的其他错误获得任何帮助吗?
【问题讨论】:
标签: firebase google-cloud-firestore google-cloud-functions