recently using IndexedDB does not quite understand how to use index + cursor to make a fuzzy query of a date
for example, the index I built is a time stamp "PROJDATE": "0:00:00 on 2019-1-9" I want to use a fuzzy query to query it as long as it matches the data
of January 9th. I hope the great god can give us some advice
success: function(res) {
//
initDateFormat();
var users = JSON.parse(res);
var tx = db.transaction("users", READ_WRITE);
var store = tx.objectStore("users");
var i = 0, len = users.length;
while(i < len){
var req= store.put(users[iPP]);
req.onsuccess = function (evt) {
console.debug("");
};
req.onerror = function (evt) {
console.error(":", evt.target.errorCode || evt.target.error);
};
}
var index = store.index("PROJDATE");
var request = index.openCursor("2019/1/9");
request.onsuccess = function(evt){
var res = evt.target.result;
console.log(JSON.stringify(res));
}
request.onerror = function(evt){
.....
}
}