createIndex

fun createIndex(name: String, keyPath: String, options: IDBIndexParameters = definedExternally): IDBIndex(source)

Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException.

Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.

MDN Reference


fun createIndex(name: String, keyPath: ReadonlyArray<String>, options: IDBIndexParameters = definedExternally): IDBIndex(source)