IDBCursorSync Redirect 1

Draft
This page is not complete.

The IDBCursorSync interface of the IndexedDB API represents a cursor for iterating over multiple records in a database. You can have only one instance of IDBCursorSync representing a cursor, but you can have an unlimited number of cursors at the same time. Operations are performed on the underlying index or object store. It enables an application to synchronously process all the records in the cursor's range.

Method overview

bool continue (in optional any key);
void remove () raises (IDBDatabaseException);

Attributes

Attribute Type Description
count readonly unsigned long long The total number of objects that share the current key.
direction readonly unsigned short The direction of traversal of the cursor. See Constants for possible values.
key readonly any The key for the record at the cursor's position.
value any

The value for the record at the cursor's position. Setting this attribute can raise an IDBDatabaseException with the following codes:

DATA_ERR
If the underlying object store uses in-line keys and the property at the key path does not match the key in this cursor's position.
NOT_ALLOWED_ERR
If the underlying index or object store does not support updating the record because it is open in the READ_ONLY or SNAPSHOT_READ mode, or if an index record cannot be changed because the underlying index is auto-populated.
SERIAL_ERR
If the data being stored could not be serialized by the internal structured cloning algorithm.

Constants

Constant Value Description
NEXT 0 This cursor includes duplicates, and its direction is monotonically increasing in the order of keys.
NEXT_NO_DUPLICATE 1 This cursor does not include duplicates, and its direction is monotonically increasing in the order of keys.
PREV 2 This cursor includes duplicates, and its direction is monotonically decreasing in the order of keys.
PREV_NO_DUPLICATE 3 This cursor does not include duplicates, and its direction is monotonically decreasing in the order of keys.

Methods

continue()

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, advance to the immediate next position. Returns false if the cursor has reached the end of its range; otherwise returns true.

bool continue (
  in optional any key
);
Parameters
key
The key to which to move the cursor's position.

remove()

Deletes the record at the cursor's position, without changing the cursor's position

void delete (
) raises (DatabaseException);
Exceptions

This method can raise an IDBDatabaseException with the following code:

NOT_ALLOWED_ERR
If the underlying index or object store does not support updating the record because it is open in the READ_ONLY or SNAPSHOT_READ mode.

Document Tags and Contributors

Contributors to this page: teoli
Last updated by: teoli,