What you are doing is the best way. Indexeddb does not have high level api.
inserting and getting bulk indexed DB data as json
-
11-10-2022 - |
Question
I am creating an application to save data locally using IndexexDB. Is there any way to get and insert bulk data from a indexed DB as json.This is what i have done so far
var request = store.openCursor();
request.onsuccess = function(evt) {
var cursor = evt.target.result;
if (cursor) {
alert("id: " + cursor.key + " is " + cursor.value.name + " ");
cursor.continue();
}
else {
console.log("No more entries!");
}
};
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow