我在 Angular 下工作,在我的部门中,我尝试请求在文档表格中添加 ID。
在此之前,我必须检查该 ID 是否存在于表中,以避免重复。
为此,我需要第一个请求,该请求将向我发送一个布尔值,我只得到 objects AngularFirestoreCollection<unknown>。

usePromoCode(userId: string, promoCode: string) {
this.firestore.collection('promoCode').doc(promoCode).get().switchMap(res => {
return of(null)
})
let bool: boolean = this.firestore.collection('promoCode', ref => ref
.where('uid', '==', promoCode)
);
}
我开始尝试这个,但没有任何效果,我不知道该怎么做......