delete method

Deletes a record object from an object store.

Internet Explorer 10



var retVal = IDBObjectStore.delete(key);


key [in]

Type: any

The key value of the record object to be deleted.


This method can throw the following DOMException exceptions:

Note  As of Internet Explorer 10, the code property is deprecated in favor of the name property, which is preferred for standards compliance and future compatibility.
Exception propertiesCondition
name: ReadOnlyError

The associated transaction is read-only.

name: TransactionInactiveError

The associated transaction has closed or is not active.


Standards information


The following example is taken from a success event handler; it deletes a record from an object store if the value associated with the record is not part of an array. For more info, see Managing data with transactions.

                var oCursor =;
                if ( oCursor ) { 
                   var sTag = oCursor.value.TagWord;
                   var iIndexNo = this._ImageTags.indexOf( sTag );
                   if ( iIndexNo == -1 ) {
                      var hReqDelTag = oCursor.source.objectStore.delete( oCursor.primaryKey );
                      hReqDelTag.onsuccess = handleRequestEvent;
                      hReqDelTag.onerror = handleRequestEvent;
                   } else {
                      this._ImageTags[ iIndexNo ] = "";   

See also