我需要在“quentinhas”中搜索文档,其中搜索参数是“diasDaSemana”......
就像是:
buscarPorDiaDaSemana(diaDaSemana) {
if (diaDaSemana != "") {
this.quentinhaCollection = this.afs.collection('quentinhas', ref => {
console.log(diaDaSemana)
return ref.where('diasDaSemana', '==', diaDaSemana);
});
}
this.quentinhas = this.quentinhaCollection.snapshotChanges()
.map(actions => {
return actions.map(a => {
const data = a.payload.doc.data();
const id = a.payload.doc.id;
return { id, data };
});
});
return this.quentinhas
}
但是此代码不适用于在该列表中搜索。
下图火库: