This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

delete

Summary

Removes a record from the specified Object Store.

Method of apis/indexeddb/IDBObjectStoreapis/indexeddb/IDBObjectStore

Syntax

var idbRequest = objectStore.delete(key);

Parameters

key

Data-type
String

Key identifying the record to be deleted

Return Value

Returns an object of type DOM NodeDOM Node

Returns an IDBRequest Object

Examples

store = db.createObjectStore("store1", { autoIncrement: true });
store.put("a"); // Will get key 1
store.delete(1);
store.put("b"); // Will get key 2
store.clear();
store.put("c"); // Will get key 3
store.delete(IDBKeyRange.lowerBound(0));

View live example

Notes

Remarks

This method can throw the following DOMException exceptions:

Exception properties Description

name: ReadOnlyError
The associated transaction is read-only.

name: TransactionInactiveError
The associated transaction is not active.

Related specifications

W3C IndexedDB Specification
W3C Proposed Recommendation

Attributions