vue.js - Firestore : "There was an unknown error while processing the request"

标签 vue.js google-cloud-firestore

这是我的查询:

var timesRef = db.collection('times');
var timesWeek = timesRef
  .where('Date', '>=', this.mon)
  .where('Date', '<=', this.sun)
  .where('Task', '==', this.task)
  .where('User', '==', this.user);
timesWeek.get()
.then(function(querySnapshot) {
  querySnapshot.forEach(function(doc) {
    console.log(doc.data());
  });
})
.catch(function(error) {
  console.log('Error getting documents: ', error);
});

它会产生这个错误:

Error: The query requires an index. You can create it here: https://console.firebase.google.com/project/myprojectlog-bd174/database/firestore/indexes?create_index=EgV0aW1lcxoICgRUYXNr...CGggKBERhdGUQAhoMCghfX25hbWVfXxAC

问题是,当我单击该链接时,我到达了一个页面,中间有一条错误消息:“处理请求时出现未知错误。请重试”。每一次。

发生这种情况是否有典型原因?

我知道我可以手动创建复合索引,但我没能成功(我尝试使用 Date: ascendingTask: ascending 创建一个, User: ascending, 我遇到了同样的错误)。

以防万一这里有一个 screenshot of the browser console .

最佳答案

验证该项目是否与您当前的帐户相对应,或者尝试使用该项目的相应帐户注销/登录。

关于vue.js - Firestore : "There was an unknown error while processing the request",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53401430/

相关文章:

css - Vuetify 全屏轮播

javascript - Vue.js 路由器不显示正确的子路由

javascript - Angular Firestore : What is the correct syntax for a collection query that uses a where clause?

java - 如何在不使用 addSnapshotListener 的情况下检索文档大小?

flutter - Flutter:根据Cloud Firestore中是否存在文档更新图标小部件

firebase - 如何将图标上传到Firebase存储

firebase - 如何配置 Firebase 项目的规则以确保安全?

vue.js - VueJs,Vue-chartjs - 变异 Prop

vue.js - 构建新的 Vue CLI 3 项目时,如何修复 terser-webpack-plugin 中的 'TypeError: Cannot read property ' minify' of undefined'?

javascript - 如何使 BootstrapVue 工具提示在 2 秒后消失?