Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

IDBIndex

import { IDBIndex } from "https://raw.githubusercontent.com/aaronhuggins/indexeddb/main/ponyfill.ts";

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.

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

§Properties

§
readonly keyPath: string | string[]
[src]
§
readonly multiEntry: boolean
[src]
§
name: string
[src]

Returns the name of the index.

§
readonly objectStore: IDBObjectStore
[src]

Returns the IDBObjectStore the index belongs to.

§
prototype: IDBIndex
[src]
§
readonly unique: boolean
[src]

§Methods

§
count(query?: IDBValidKey | IDBKeyRange): IDBRequest<number>
[src]

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

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

§
get(query: IDBValidKey | IDBKeyRange): IDBRequest<any>
[src]

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.

§
getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>
[src]

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.

§
getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>
[src]

Retrieves the keys of 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 keys.

§
getKey(query: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey | undefined>
[src]

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

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

§
openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>
[src]

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

If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records.

§
openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>
[src]

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.

If successful, request's result will be an IDBCursor, or null if there were no matching records.