【发布时间】:2018-08-08 00:45:18
【问题描述】:
在我的函数中,我有两个 where 子句。我想要的是检查一个文档是否存在,其中找到了两个 id。但是当我运行它时,它会返回所有收集记录。谁能告诉我我在哪里搞砸了?
setApplyStatus() {
var query = firebase.firestore().collection('applications')
query.where("jobSeekerId", '==', this.jobSeekerId).get()
query.where("jobId", '==', this.job.id)
query.get().then(querySnapshot => {
querySnapshot.forEach(doc => {
console.log(doc.data())
console.log('already exists')
this.applyStatus = true
})
})
}
【问题讨论】:
标签: javascript firebase vue.js google-cloud-firestore