createIndex method

IDBIndex createIndex(
  1. String name,
  2. JSAny keyPath, [
  3. IDBIndexParameters options
])

The createIndex() method of the IDBObjectStore interface creates and returns a new IDBIndex object in the connected database. It creates a new field/column defining a new data point for each database record to contain.

Bear in mind that IndexedDB indexes can contain any JavaScript data type; IndexedDB uses the structured clone algorithm to serialize stored objects, which allows for storage of simple and complex objects.

Note that this method must be called only from a VersionChange transaction mode callback.

Implementation

external IDBIndex createIndex(
  String name,
  JSAny keyPath, [
  IDBIndexParameters options,
]);