javascript - 无法执行多个查询索引的 Firestore 集合
问题描述
所以我尝试使用这个函数从firebase获取数据
getData(){
const startDate = this.$store.state.inputFilter.rangeDate.start
const endDate = this.$store.state.inputFilter.rangeDate.end
db.collection(this.inputType)
.where('idAlat', '==',this.equipment)
.where('tanggal', '>=', startDate).where('tanggal', '<=', endDate)
.where('project', '==', this.project)
.get().then(docs => {
docs.forEach(doc => {
console.log(doc.data().tanggal.toDate(), doc.data().idAlat)
})
})
}
但是每次我尝试运行该功能时,它都会在控制台中显示如下错误:
但是然后我按照链接并按照说明在firebase中创建复合索引,如下所示:
我做错了什么吗?谢谢!
PS:“tanggal”一词在英语中的意思是“日期”
解决方案
推荐阅读
- sql - SQL teradata 在列中搜索字符串并创建新列
- vue.js - 在运行 Vue-Router 防护之前,如何读取和解析 cookie 并将结果存储在 Vuex 中
- c# - 实体类型
不是当前上下文模型的一部分 - git - 将元数据添加到 git commit 以获取有关如何测试的说明
- regex - 谷歌表格正则提取每个单词的第一个字母
- python - 枚举python中类的所有属性
- java - 如何使条形图透明
- ember.js - 要求覆盖 Ember.js 文件时,Visual Studio Code 终端冻结
- python-3.x - 如何在熊猫中找到一个列与另一个条件列的总和
- python - Docker 在运行 docker-compose 时以代码 0 退出