我正在尝试从具有两个collection
条件的where
获取数据。我面临的问题是,我需要按两次获取数据按钮。我不明白为什么。
这是我的功能:
async get_data(){
console.log(this.mnth);
console.log(this.selected_user_authId);
//where condition
await this.firestore.collection("complaints",ref => ref
.where("complaint_agent_id", "==", this.selected_user_authId)
.where("complaint_date_month", "==", this.mnth)
.orderBy('ticketid', 'desc')
)
.get()
.subscribe(response => {
console.log("insidesub")
if(!response.docs.length){
console.log("no data available");
return false;
}
this.goalList=[];
for(let item of response.docs){
var data = Object.assign(item.data(), {docid : item.id})
this.goalList.push(data);
}
}
console.log(this.goalList);
)}
我的 console.log 屏幕截图
我的索引图像,我单击console.log中的链接以创建此索引
哪里可能出问题了?