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.

deleteIndex

Summary

This method destroys the index with the given name in the connected database. Note that this method must only be called from a “versionchange” transaction callback.

Method of apis/indexeddb/IDBObjectStoreapis/indexeddb/IDBObjectStore

Syntax

 objectStore.deleteIndex(indexName);

Parameters

indexName

Data-type
String

Name of the index to be deleted.

Return Value

No return value

Examples

var objectStore = transaction.objectStore("ObjectStore_BookList");
objectStore.deleteIndex("priceIndex");

View live example

Notes

Throws an exception when

  • This method was not called from a “versionchange” transaction callback.
  • There is no index with the given name, compared in a case-sensitive manner, in the connected database.

Related specifications

W3C IndexedDB Specification
W3C Proposed Recommendation

Attributions