Dart API Referencedart:htmlIDBCursor

IDBCursor Interface

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

Subinterfaces

IDBCursorWithValue

Static Fields

Code final int NEXT #

static final int NEXT = 0;

Code final int NEXT_NO_DUPLICATE #

static final int NEXT_NO_DUPLICATE = 1;

Code final int PREV #

static final int PREV = 2;

Code final int PREV_NO_DUPLICATE #

static final int PREV_NO_DUPLICATE = 3;

Methods

Code void advance(int count) #

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

IDBRequest advance (
  in long count
) raises (IDBDatabaseException);
Parameter
count
The number of advances forward the cursor should make.
Returns
void
Exceptions

This method can raise an IDBDatabaseException with the following codes:

Exception Description
NON_TRANSIENT_ERR

The value passed into the count parameter was zero or a negative number.

NOT_ALLOWED_ERR The cursor was created using openKeyCursor(), or if it is currently being iterated (you cannot call this method again until the new cursor data has been loaded), or if it has iterated past the end of its range.
TRANSACTION_INACTIVE_ERR The transaction that this cursor belongs to is inactive.
void advance(int count);

Code void continueFunction([key]) #

void continueFunction([/*IDBKey*/ key]);

Code IDBRequest delete() #

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.

IDBRequest delete (
) raises (IDBDatabaseException);
Returns
IDBRequest
A request object on which subsequent events related to this operation are fired. The result attribute is set to undefined.
Exceptions

This method can raise an IDBDatabaseException with the following code:

Exception Description
NOT_ALLOWED_ERR The cursor was created using openKeyCursor(), or if it is currently being iterated (you cannot call this method again until the new cursor data has been loaded), or if it has iterated past the end of its range.
READ_ONLY_ERR The cursor is in a transaction whose mode is READ_ONLY.
TRANSACTION_INACTIVE_ERR The transaction that this cursor belongs to is inactive.
IDBRequest delete();

Code IDBRequest update(value) #

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.

IDBRequest update (
  in any value
) raises (IDBDatabaseException, DOMException);
Parameter
value
The value to be stored.
Returns
IDBRequest
A request object on which subsequent events related to this operation are fired.
Exceptions

This method can raise an IDBDatabaseException with the following codes:

Exception Description
DATA_ERR

The underlying object store uses in-line keys, and the key for the cursor's position does not match the value property at the object store's key path.

NOT_ALLOWED_ERR The cursor was created using openKeyCursor(), or if it is currently being iterated (you cannot call this method again until the new cursor data has been loaded), or if it has iterated past the end of its range.
READ_ONLY_ERR The cursor is in a transaction whose mode is READ_ONLY.
TRANSACTION_INACTIVE_ERR The transaction that this cursor belongs to is inactive.

It can also raise a DOMException with the following code:

Attribute Description
DATA_CLONE_ERR If the value could not be cloned.
IDBRequest update(/*SerializedScriptValue*/ value);

Fields

Code final String direction #

On getting, returns the direction of traversal of the cursor. See Constants for possible values.
final String direction;

Code final key #

Returns the key for the record at the cursor's position. If the cursor is outside its range, this is undefined.
final Dynamic key;

Code final primaryKey #

Returns the cursor's current effective key. If the cursor is currently being iterated or has iterated outside its range, this is undefined.
final Dynamic primaryKey;

Code final source #

On getting, 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.
final Dynamic source;

This page includes content from the Mozilla Foundation that is graciously licensed under a Creative Commons: Attribution-Sharealike license. Mozilla has no other association with Dart or dartlang.org. We encourage you to improve the web by contributing to The Mozilla Developer Network.