【发布时间】:2019-02-14 01:11:42
【问题描述】:
我想使用云功能后台触发器,所以当我在 Firestore 中删除用户数据时,我想同时删除他们在 Firebase 存储中的个人资料图片。
用户ID 用作该图片的图像名称。并且图像位于 profilepicture 文件夹中
export const removeProfilePictureWhenDeletingUserData = functions.firestore
.document('userss/{userID}')
.onDelete((snap, context) => {
const userID = context.params.userID
// how to delete the image in here?
});
我已尝试阅读文档,但我对如何实现该方法感到困惑:(。真的需要你的帮助。在此先感谢
【问题讨论】:
标签: firebase google-cloud-firestore google-cloud-storage google-cloud-functions firebase-admin