Attempt #3 to fix chat filter and missing index

This commit is contained in:
Mashintime 2023-02-19 14:26:52 -05:00
parent 2a82fee9d5
commit f5c342c785

View file

@ -1502,7 +1502,17 @@ function updateAllChat(clear){
//document.getElementById("list-tab").childNodes.remove();
//document.getElementById("nav-tab-content").childrenNodes.remove();
}
//Ensure we create an index before running db.find
//We can't rely on the default index existing before we get here...... :'(
db.createIndex({
index: {
fields: [
{"timestamp":"asc"},
],
},
})
.then(function (result) {
// handle result
db.find({
selector: {
$and: [{timestamp: {$exists:true}},
@ -1532,4 +1542,9 @@ function updateAllChat(clear){
.catch(function (err) {
console.log(err);
});
})
.catch(function (err) {
console.log(err);
});
}