DELETE AN INDEXEDDB OBJECT STORE

You can delete an entire object store using the same basic code to create one, within a setVersion() request, using deleteObjectStore() :

function deleteObjectStore() {
   var request = db.setVersion('1.0');
   request.onsuccess = function(event) {
     db.deleteObjectStore(objectStore);
   };
   request.onerror = function(event) {...};
 }

The database version number remains at 1.0 because many HTML5 browsers that do support the IndexedDB API do not properly manage the database version control functionality. The purpose of this is to be able to store multiple versions of data within the same object store within the same database. Ultimately, for most applications, this is overkill; just reassign your IndexedDB database version ...

Get HTML5: Your visual blueprint™ for designing rich web pages and applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.