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.

Hierarchy

  • IDBIndex

Properties

keyPath: string | string[]
multiEntry: boolean
name: string

Returns the name of the index.

objectStore: IDBObjectStore

Returns the IDBObjectStore the index belongs to.

unique: boolean

Methods

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

    If successful, request's result will be the count.

    Parameters

    Returns IDBRequest<number>

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

    If successful, request's result will be the value, or undefined if there was no matching record.

    Parameters

    Returns IDBRequest<any>

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

    If successful, request's result will be an Array of the values.

    Parameters

    Returns IDBRequest<any[]>