Reputation: 43
I'm trying to run a firestore query in my app which is is throwing up an error that an index is missing. Firestore always used to also include a link to click for the console to create the missing index, but it's not there this time so I'm stuck! Not sure what I've done differently this time.
This is the console error:
prebuilt-d16b955d-cdb9e87f.js:188 Uncaught (in promise) FirebaseError: no matching index found.
at new e (prebuilt-d16b955d-cdb9e87f.js:188)
at prebuilt-d16b955d-cdb9e87f.js:10416
at prebuilt-d16b955d-cdb9e87f.js:10414
at e.onMessage (prebuilt-d16b955d-cdb9e87f.js:10403)
at prebuilt-d16b955d-cdb9e87f.js:10356
at prebuilt-d16b955d-cdb9e87f.js:10387
at prebuilt-d16b955d-cdb9e87f.js:15180
This is my JS function:
loadcatalogues() {
console.log(this.clubID);
this.showspinner = true;
this.catalogues = [];
var today = moment().utc().unix();
let self = this;
fb.catalogueCollection
.where("clubID", "==", this.clubID)
.where("expiry", ">", today)
.orderBy("expiry", "asc")
.orderBy("price", "asc")
.get()
.then(function (querySnapshot) {
querySnapshot.forEach(function (doc) {
if (
doc.data().members &&
doc.data().members.indexOf(self.userProfile.id) !== -1
) {
return false;
}
var starttime = moment.unix(doc.data().start).utc();
var endtime = moment.unix(doc.data().expiry).utc();
var tempdata = {
title: doc.data().title,
description: doc.data().description,
start: starttime.format("DD-MM-YYYY"),
expiry: endtime.format("DD-MM-YYYY"),
price: doc.data().price,
purchased: false,
stripeid: doc.data().stripeid,
catalogueid: doc.id,
limited: doc.data().limited,
};
self.catalogues.push(tempdata);
});
if (self.catalogues.length == 0) {
self.shownooptions = true;
}
self.showspinner = false;
});
},
If I remove the first where clause (.where("clubID", "==", this.clubID)) then the query runs fine, so I'm guessing an index already exists for that query. I've only recently added the clubID field, so could that be missing an index?
Thanks!!
Upvotes: 1
Views: 119
Reputation: 43
Looks like there's currently a problem with Google firestore. Raised a support call and they have confirmed they have received several other reports of this and their engineering team are investigating.
Upvotes: 2