Javascript 使用angular从Firestorage中删除目录,不允许删除数据
我使用Spring Boot和Mongo作为后端在Angular中构建这个应用程序,在它的一个端点中,我删除了存储在我的Mongo db中的对象,该数据库也引用了firebase存储数据库,以便在其中堆叠视频或图像。 从mongo删除的过程正常,但参考my childs的存储位置,会出现“找不到。无法获取对象”的错误Javascript 使用angular从Firestorage中删除目录,不允许删除数据,javascript,firebase,firebase-storage,Javascript,Firebase,Firebase Storage,我使用Spring Boot和Mongo作为后端在Angular中构建这个应用程序,在它的一个端点中,我删除了存储在我的Mongo db中的对象,该数据库也引用了firebase存储数据库,以便在其中堆叠视频或图像。 从mongo删除的过程正常,但参考my childs的存储位置,会出现“找不到。无法获取对象”的错误 delete(postId: string) { this.postService.deleteAPost(postId).subscribe((result)
delete(postId: string) {
this.postService.deleteAPost(postId).subscribe((result) => {//1rst step
for (let x = 0; x < result.videos.length; x++) {//2nd step
this.fireStorage
.ref('videos/' + postId)//reference
.child(postId + '-' + x)//child specific to delete
.delete();
}
});
}
提前感谢您的支持
delete(postId: string) {
this.postService.deleteAPost(postId).subscribe((result) => {//1rst step
for (let x = 0; x < result.videos.length; x++) {//2nd step
this.fireStorage
.storage
.refFromURL('videos/' + postId+'/'+postId + '-' + x)
.delete()
}
});
}