public interface IDBCursor
IDBCursor
interface of the IndexedDB API represents a cursor for traversing or iterating over multiple records in a database.Modifier and Type | Field and Description |
---|---|
static int |
NEXT
The cursor shows all records, including duplicates.
|
static int |
NEXT_NO_DUPLICATE
The cursor shows all records, excluding duplicates.
|
static int |
PREV
The cursor shows all records, including duplicates.
|
static int |
PREV_NO_DUPLICATE
The cursor shows all records, excluding duplicates.
|
Modifier and Type | Method and Description |
---|---|
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. |
void |
advance(int count)
Sets the number times a cursor should move its position forward.
|
void |
continueFunction() |
void |
continueFunction(Object key) |
String |
getDirection()
On getting, returns the direction of traversal of the cursor.
|
Object |
getKey()
Returns the key for the record at the cursor's position.
|
Object |
getPrimaryKey()
Returns the cursor's current effective key.
|
Object |
getSource()
On getting, returns the
IDBObjectStore or IDBIndex that the cursor is iterating. |
IDBRequest |
update(Object value)
Returns an IDBRequest object, and, in a separate thread, updates the value at the current position of the cursor in the object store.
|
static final int NEXT
static final int NEXT_NO_DUPLICATE
static final int PREV
static final int PREV_NO_DUPLICATE
String getDirection()
Object getKey()
undefined
.Object getPrimaryKey()
undefined
.Object getSource()
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.void advance(int count)
Sets the number times a cursor should move its position forward.
IDBRequest advance ( in long count ) raises (IDBDatabaseException);
void
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 continueFunction()
void continueFunction(Object key)
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);
IDBRequest
result
attribute is set to undefined
.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 update(Object 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);
IDBRequest
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. |
Copyright © 2018. All rights reserved.