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));
Notes
Remarks
This method can throw the following DOMException exceptions:
Exception properties | Description |
|
The associated transaction is read-only. |
|
The associated transaction is not active. |
Related specifications
- W3C IndexedDB Specification
- W3C Proposed Recommendation
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]