CloudFunctionsでFirebaseStorageのフォルダーを削除
CloudFunctionsでFirebaseStorageのフォルダーを削除
posts/{uid}/hoge.mp4
userImages/{uid}/pfp.jpeg
postImages/{uid}/postImage.png
があるとする
index.js
const bucket = admin.storage().bucket();
const uid = 'hogehoge';
// delete post storage
bucket.deleteFiles({
prefix: `posts/${uid}`
});
// delete userImage storage
bucket.deleteFiles({
prefix: `userImages/${uid}`
});
// delete postImages storage
bucket.deleteFiles({
prefix: `postImages/${uid}`
});
Author And Source
この問題について(CloudFunctionsでFirebaseStorageのフォルダーを削除), 我々は、より多くの情報をここで見つけました https://qiita.com/Nekoyama141592/items/da212ea2dd7d5d66ca61著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .