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

IDBCursor

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

This IndexedDB API interface represents a cursor for traversing or iterating over multiple records in a database.

interface IDBCursor {
readonly direction: IDBCursorDirection;
readonly key: IDBValidKey;
readonly primaryKey: IDBValidKey;
prototype: IDBCursor;
readonly request: IDBRequest;
readonly source: IDBObjectStore | IDBIndex;
advance(count: number): void;
continue(key?: IDBValidKey): void;
continuePrimaryKey(key: IDBValidKey, primaryKey: IDBValidKey): void;
delete(): IDBRequest<undefined>;
new (): IDBCursor;
update(value: any): IDBRequest<IDBValidKey>;
}
const IDBCursor;

§Properties

§
readonly direction: IDBCursorDirection
[src]

Returns the direction ("next", "nextunique", "prev" or "prevunique") of the cursor.

§
readonly key: IDBValidKey
[src]

Returns the key of the cursor. Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished.

§
readonly primaryKey: IDBValidKey
[src]

Returns the effective key of the cursor. Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished.

§
prototype: IDBCursor
[src]
§
readonly request: IDBRequest
[src]
§
readonly source: IDBObjectStore | IDBIndex
[src]

Returns the IDBObjectStore or IDBIndex the cursor was opened from.

§Methods

§
advance(count: number): void
[src]

Advances the cursor through the next count records in range.

§
continue(key?: IDBValidKey): void
[src]

Advances the cursor to the next record in range.

§
continuePrimaryKey(key: IDBValidKey, primaryKey: IDBValidKey): void
[src]

Advances the cursor to the next record in range matching or after key and primaryKey. Throws an "InvalidAccessError" DOMException if the source is not an index.

§
delete(): IDBRequest<undefined>
[src]

Delete the record pointed at by the cursor with a new value.

If successful, request's result will be undefined.

§
update(value: any): IDBRequest<IDBValidKey>
[src]

Updated the record pointed at by the cursor with a new value.

Throws a "DataError" DOMException if the effective object store uses in-line keys and the key would have changed.

If successful, request's result will be the record's key.