Firestore数据库突发删除求助:数据恢复与原因排查
Firestore数据库全部数据消失,请求排查原因及恢复方案
本地测试新开发功能时,发现对Firestore数据库的请求无任何反馈。登录Firebase项目控制台查看后,确认数据库及所有文档、记录已完全消失。
当前影响
- 用户仅能完成认证操作,无法使用依赖Firestore数据的其他功能
- 项目进度受阻,新功能无法开展测试
已采取行动
已联系谷歌官方,但尚未收到回复
需求
- 排查Firestore数据库被删除的可能原因
- 确认是否可以恢复数据库及全部文档、记录(数据恢复至关重要,绝不可接受数据丢失)
相关代码片段
firebase.service.ts
async getCustomerProjects(customerId) { const querySnapshot = await this.db .collection("projects", (ref) => ref.where("customer", "==", customerId) ) .get() .toPromise(); const projects = []; querySnapshot.forEach((doc) => { const project: any = doc.data(); project.id = doc.id; projects.push(project); }); return projects; }
integration.component.ts
this.customerSubscription = this._storageService .getSelectedCustomer() .subscribe(async (customer) => { this.selectedCustomer = customer; if (customer) { const customerProjects = await this.firebaseService.getCustomerProjects(customer.id); this.showContent = false; if (customerProjects.length > 0) { this.showSelectProject = true; this.showCustomerHasNoProject = false; this.showProjectHasNoCampaign = false; } else { this.showSelectProject = false; this.showCustomerHasNoProject = true; this.showProjectHasNoCampaign = false; } } });
内容的提问来源于stack exchange,提问作者Ricardo
相关产品推荐
相关产品推荐

