Join us online - 19th of November
Save your spot
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 IDBCursorWithValue

The IDBCursorWithValue interface of the IndexedDB API represents a cursor for traversing or iterating over multiple records in a database. It is the same as the IDBCursor, except that it includes the value property.

MDN Reference

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

Hierarchy (View Summary)

Index

The direction read-only property of the IDBCursor interface is a string that returns the direction of traversal of the cursor (set using IDBObjectStore.openCursor for example). See the Value section below for possible values.

MDN Reference

The key read-only property of the IDBCursor interface returns the key for the record at the cursor's position. If the cursor is outside its range, this is set to undefined. The cursor's key can be any data type.

MDN Reference

primaryKey: IDBValidKey

The primaryKey read-only property of the IDBCursor interface returns the cursor's current effective key. If the cursor is currently being iterated or has iterated outside its range, this is set to undefined. The cursor's primary key can be any data type.

MDN Reference

request: IDBRequest

The request read-only property of the IDBCursor interface returns the IDBRequest used to obtain the cursor.

MDN Reference

The source read-only property of the IDBCursor interface returns the IDBObjectStore or IDBIndex that the cursor is iterating over. This function never returns null or throws an exception, even if the cursor is currently being iterated, has iterated past its end, or its transaction is not active.

MDN Reference

value: any

The value read-only property of the IDBCursorWithValue interface returns the value of the current cursor, whatever that is.

MDN Reference

  • The advance() method of the IDBCursor interface sets the number of times a cursor should move its position forward.

    MDN Reference

    Parameters

    • count: number

    Returns void

  • The continue() method of the IDBCursor interface advances the cursor to the next position along its direction, to the item whose key matches the optional key parameter. If no key is specified, the cursor advances to the immediate next position, based on its direction.

    MDN Reference

    Parameters

    Returns void

  • The delete() method of the IDBCursor interface returns an IDBRequest object, and, in a separate thread, deletes the record at the cursor's position, without changing the cursor's position. Once the record is deleted, the cursor's value is set to null.

    MDN Reference

    Returns IDBRequest<undefined>

  • The update() method of the IDBCursor interface returns an IDBRequest object, and, in a separate thread, updates the value at the current position of the cursor in the object store. If the cursor points to a record that has just been deleted, a new record is created.

    MDN Reference

    Parameters

    • value: any

    Returns IDBRequest<IDBValidKey>

Was this helpful?