February 2018
Intermediate to advanced
298 pages
8h 22m
English
Similar to writing and reading, we can also delete data from the object store, as well, as follows:
const open = window.indexedDB.open("types", 1); // same database as aboveopen.onsuccess = () => { const dbHandler = open.result; const transaction = dbHandler.transaction(['frontend'], 'readwrite'); const storeHandler = transaction.objectStore('frontend'); storeHandler.delete("HTML5");};
The only thing we did here was using the delete method. Note that we have to give the readwrite access to the transaction in order to delete the record.
Read now
Unlock full access