IDBIndex

sealed external class IDBIndex(source)

IDBIndex interface of the IndexedDB API provides asynchronous access to an index in a database. An index is a kind of object store for looking up records in another object store, called the referenced object store. You use this interface to retrieve data.

MDN Reference

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the name of the index.

Link copied to clipboard

Returns the IDBObjectStore the index belongs to.

Link copied to clipboard

Functions

Link copied to clipboard

fun count(query: IDBValidKey = definedExternally): IDBRequest<Int>

Retrieves the number of records matching the given key or key range in query.

Link copied to clipboard
operator fun get(query: IDBKeyRange): IDBRequest<*>

operator fun get(query: IDBValidKey): IDBRequest<*>

Retrieves the value of the first record matching the given key or key range in query.

Link copied to clipboard
fun getAll(query: IDBKeyRange?, count: Int = definedExternally): IDBRequest<ReadonlyArray<*>>

fun getAll(query: IDBValidKey? = definedExternally, count: Int = definedExternally): IDBRequest<ReadonlyArray<*>>

Retrieves the values of the records matching the given key or key range in query (up to count if given).

Link copied to clipboard
fun getAllKeys(query: IDBKeyRange?, count: Int = definedExternally): IDBRequest<ReadonlyArray<IDBValidKey>>

fun getAllKeys(query: IDBValidKey? = definedExternally, count: Int = definedExternally): IDBRequest<ReadonlyArray<IDBValidKey>>

Retrieves the keys of records matching the given key or key range in query (up to count if given).

Link copied to clipboard

Retrieves the key of the first record matching the given key or key range in query.

Link copied to clipboard
fun openCursor(query: IDBKeyRange?, direction: IDBCursorDirection = definedExternally): IDBRequest<IDBCursorWithValue?>

fun openCursor(query: IDBValidKey? = definedExternally, direction: IDBCursorDirection = definedExternally): IDBRequest<IDBCursorWithValue?>

Opens a cursor over the records matching query, ordered by direction. If query is null, all records in index are matched.

Link copied to clipboard
fun openKeyCursor(query: IDBKeyRange?, direction: IDBCursorDirection = definedExternally): IDBRequest<IDBCursor?>

fun openKeyCursor(query: IDBValidKey? = definedExternally, direction: IDBCursorDirection = definedExternally): IDBRequest<IDBCursor?>

Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in index are matched.