For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.
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(
queryOrOptions?: IDBValidKey | IDBKeyRange | null,
count?: number,
): IDBRequest<any[]>;
getAllKeys(
queryOrOptions?: IDBValidKey | IDBKeyRange | null,
count?: number,
): IDBRequest<IDBValidKey[]>;
getKey(
query: IDBValidKey | IDBKeyRange,
): IDBRequest<IDBValidKey | undefined>;
openCursor(
query?: IDBValidKey | IDBKeyRange | null,
direction?: IDBCursorDirection,
): IDBRequest<IDBCursorWithValue | null>;
openKeyCursor(
query?: IDBValidKey | IDBKeyRange | null,
direction?: IDBCursorDirection,
): IDBRequest<IDBCursor | null>;
}
Properties
ReadonlykeyPath
The keyPath property of the IDBIndex interface returns the key path of the current index. If null, this index is not auto-populated.
ReadonlymultiEntry
The multiEntry read-only property of the IDBIndex interface returns a boolean value that affects how the index behaves when the result of evaluating the index's key path yields an array.
name
The name property of the IDBIndex interface contains a string which names the index.
ReadonlyobjectStore
The objectStore property of the IDBIndex interface returns the object store referenced by the current index.
Readonlyunique
The unique read-only property returns a boolean that states whether the index allows duplicate keys.
Methods
count
-
The
count()method of the IDBIndex interface returns an IDBRequest object, and in a separate thread, returns the number of records within a key range.Parameters
Optionalquery: IDBValidKey | IDBKeyRange
Returns IDBRequest<number>
get
-
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 IDBKeyRange.Parameters
- query: IDBValidKey | IDBKeyRange
Returns IDBRequest<any>
getAll
-
The
getAll()method of the IDBIndex interface retrieves all objects that are inside the index.Parameters
OptionalqueryOrOptions: IDBValidKey | IDBKeyRange | nullOptionalcount: number
Returns IDBRequest<any[]>
getAllKeys
-
getAllKeys(
queryOrOptions?: IDBValidKey | IDBKeyRange | null,
count?: number,
): IDBRequest<IDBValidKey[]>The
getAllKeys()method of the IDBIndex interface asynchronously retrieves the primary keys of all objects inside the index, setting them as the result of the request object.Parameters
OptionalqueryOrOptions: IDBValidKey | IDBKeyRange | nullOptionalcount: number
Returns IDBRequest<IDBValidKey[]>
getKey
-
The
getKey()method of the IDBIndex interface returns an IDBRequest object, and, in a separate thread, finds either the primary key that corresponds to the given key in this index or the first corresponding primary key, if key is set to an IDBKeyRange.Parameters
- query: IDBValidKey | IDBKeyRange
Returns IDBRequest<IDBValidKey | undefined>
openCursor
-
openCursor(
query?: IDBValidKey | IDBKeyRange | null,
direction?: IDBCursorDirection,
): IDBRequest<IDBCursorWithValue | null>The
openCursor()method of the IDBIndex interface returns an IDBRequest object, and, in a separate thread, creates a cursor over the specified key range.Parameters
Optionalquery: IDBValidKey | IDBKeyRange | nullOptionaldirection: IDBCursorDirection
Returns IDBRequest<IDBCursorWithValue | null>
openKeyCursor
-
openKeyCursor(
query?: IDBValidKey | IDBKeyRange | null,
direction?: IDBCursorDirection,
): IDBRequest<IDBCursor | null>The
openKeyCursor()method of the IDBIndex interface returns an IDBRequest object, and, in a separate thread, creates a cursor over the specified key range, as arranged by this index.Parameters
Optionalquery: IDBValidKey | IDBKeyRange | nullOptionaldirection: IDBCursorDirection
Returns IDBRequest<IDBCursor | null>
IDBIndexinterface 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