【发布时间】:2021-01-06 13:05:51
【问题描述】:
如何根据条件更改此查询
let query = (ref: CollectionReference)=>{
return ref.where("dateOrd", ">=", this.dateIn)
.where("dateOrd", "<=", this.dateOu)
.where("status", "==", this.staTus)
.where("seller", "==", this.idseller)
.where("ptype", "in", this.ptype)
.orderBy("dateOrd", "desc")
.orderBy("creado", "desc")
.limit(5000)
}
例如,如果满足某个条件,则更改查询
类似的东西(失败)
if (typeof this.idCli!="undefined"){
query = query.where("client", "==", this.idCli)
}
但是,我该如何进行多重查询呢?
请帮助我。谢谢
【问题讨论】:
标签: javascript angular firebase google-cloud-firestore