Chartbreaker
    Preparing search index...

    Interface IDBIndex

    IDBIndex interface of the IndexedDB API provides asynchronous access to an index in a database.

    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<any>;
        getAll(
            query?: null | IDBValidKey | IDBKeyRange,
            count?: number,
        ): IDBRequest<any[]>;
        getAllKeys(
            query?: null | IDBValidKey | IDBKeyRange,
            count?: number,
        ): IDBRequest<IDBValidKey[]>;
        getKey(
            query: IDBValidKey | IDBKeyRange,
        ): IDBRequest<undefined | IDBValidKey>;
        openCursor(
            query?: null | IDBValidKey | IDBKeyRange,
            direction?: IDBCursorDirection,
        ): IDBRequest<null | IDBCursorWithValue>;
        openKeyCursor(
            query?: null | IDBValidKey | IDBKeyRange,
            direction?: IDBCursorDirection,
        ): IDBRequest<null | IDBCursor>;
    }
    Index

    Properties

    keyPath: string | string[]

    The keyPath property of the IDBIndex interface returns the key path of the current index.

    MDN Reference

    multiEntry: boolean

    The multiEntry read-only property of the behaves when the result of evaluating the index's key path yields an array.

    MDN Reference

    name: string

    The name property of the IDBIndex interface contains a string which names the index.

    MDN Reference

    objectStore: IDBObjectStore

    The objectStore property of the IDBIndex interface returns the object store referenced by the current index.

    MDN Reference

    unique: boolean

    The unique read-only property returns a boolean that states whether the index allows duplicate keys.

    MDN Reference

    Methods

    • The get() method of the IDBIndex interface returns an IDBRequest object, and, in a separate thread, finds either the value in the referenced object store that corresponds to the given key or the first corresponding value, if key is set to an If a value is found, then a structured clone of it is created and set as the result of the request object: this returns the record the key is associated with.

      MDN Reference

      Parameters

      Returns IDBRequest<any>