Interface IDBIndex

    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

    interface IDBIndex {
        keyPath: string | string[];
        multiEntry: boolean;
        name: string;
        objectStore: IDBObjectStore;
        unique: boolean;
        count(query?: IDBValidKey | IDBKeyRange): IDBRequest<number>;
        get(query: IDBValidKey | IDBKeyRange): IDBRequest;
        getAll(
            query?: IDBValidKey | IDBKeyRange,
            count?: number,
        ): IDBRequest<any[]>;
        getAllKeys(
            query?: IDBValidKey | IDBKeyRange,
            count?: number,
        ): IDBRequest<IDBValidKey[]>;
        getKey(query: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey>;
        openCursor(
            query?: IDBValidKey | IDBKeyRange,
            direction?: IDBCursorDirection,
        ): IDBRequest<IDBCursorWithValue>;
        openKeyCursor(
            query?: IDBValidKey | IDBKeyRange,
            direction?: IDBCursorDirection,
        ): IDBRequest<IDBCursor>;
    }

    Properties

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

    Returns the name of the index.

    MDN Reference

    objectStore: IDBObjectStore

    Returns the IDBObjectStore the index belongs to.

    MDN Reference

    unique: boolean

    Methods