kiwi1342
kiwi1342

Reputation: 1389

Remove specific storage from indexeddb

I was wondering if it's possible to remove a specific storage from and indexeddb or, in case this is not possible, how to clean all records inside a storage.

Thanks

Upvotes: 0

Views: 134

Answers (1)

Sathya Raj
Sathya Raj

Reputation: 1089

use delete(ID); function in indexeddb

var request = store.delete(id);

  request.onsuccess = function(e) {
    console.log("deleted")  
  };

  request.onerror = function(e) {
    console.log("error--"+e);
  };

yes to delete entire store

 db.deleteObjectStore("storeName");

refer this for more

Upvotes: 1

Related Questions