我想知道是否可以从 indexeddb 中删除特定存储,或者如果不可能,如何清除存储内的所有记录。
谢谢
最佳答案
在indexeddb中使用delete(ID);
函数
var request = store.delete(id);
request.onsuccess = function(e) {
console.log("deleted")
};
request.onerror = function(e) {
console.log("error--"+e);
};
是删除整个商店
db.deleteObjectStore("storeName");
引用此more
关于javascript - 从indexeddb中删除特定存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24449103/