Cursor

js.html.idb.Cursor (extern class)

The IDBCursor interface of the IndexedDB API represents a cursor for traversing or iterating over multiple records in a database.

Documentation IDBCursor by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Instance Members

Returns the IDBObjectStore or IDBIndex that the cursor is iterating. 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.


direction: CursorDirection

Returns the direction of traversal of the cursor. See Constants for possible values.


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.


primaryKey: Dynamic

Returns the cursor's current effective primary 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.


update(value: Dynamic): Request

Returns an IDBRequest object, and, in a separate thread, updates the value at the current position of the cursor in the object store. This can be used to update specific records.

Name Type
value Dynamic
Returns
Request

advance(count: Int): Void

Sets the number times a cursor should move its position forward.

Name Type
count Int

continue_(?key: Dynamic): Void

Advances the cursor to the next position along its direction, to the item whose key matches the optional key parameter.

Name Type Default
key Dynamic (optional)

continuePrimaryKey(key: Dynamic, primaryKey: Dynamic): Void

Sets the cursor to the given index key and primary key given as arguments.

Name Type
key Dynamic
primaryKey Dynamic

delete(): Request

Returns an IDBRequest object, and, in a separate thread, deletes the record at the cursor's position, without changing the cursor's position. This can be used to delete specific records.

Returns
Request