IDBCursor Interface
IDBCursor
interface of the IndexedDB API represents a cursor for traversing or iterating over multiple records in a database.
Subinterfaces
Static Fields
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 |
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 toundefined
.
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 |
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 key #
undefined
.
final Dynamic key;
Code final primaryKey #
undefined
.
final Dynamic primaryKey;
Code final source #
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.