Draft
This page is not complete.
Important: The synchronous version of the IndexedDB API was originally intended for use only with Web Workers, and was eventually removed from the spec because its need was questionable. It may however be reintroduced in the future if there is enough demand from web developers.
The IDBIndexSync
interface of the IndexedDB API provides synchronous access to an index in a database.
any add (in any value, in optional any key) raises (IDBDatabaseException); |
any get (in any key) raises (IDBDatabaseException); |
any getObject (in any key) raises (IDBDatabaseException); |
void openCursor (in optional IDBKeyRange range, in optional unsigned short direction) raises (IDBDatabaseException); |
void openObjectCursor (in optional IDBKeyRange range, in optional unsigned short direction) raises (IDBDatabaseException); |
any put (in any value, in optional any key) raises (IDBDatabaseException); |
void remove (in any key) raises (IDBDatabaseException); |
Attribute | Type | Description |
---|---|---|
keyPath | readonly DOMString | The key path of this index. If this attribute is null, this index is not auto-populated. |
name | readonly DOMString | The name of this index. |
storeName | readonly DOMString | This index's referenced object store. |
unique | readonly boolean | If true, a key can have only one value within the index; if false, a key can have duplicate values. |
Stores the given value into this index, optionally with the specified key. If a record already exists with the given key, an exception is raised.
any add( in any value, in optional any key ) raises (IDBDatabaseException);
This method can raise a IDBDatabaseException with the following code:
any
CONSTRAINT_ERR
Retrieves the value from this index for the record that corresponds to the given key.
any get ( in any key ) raises (IDBDatabaseException);
any
This method can raise an IDBDatabaseException with the following code:
NOT_FOUND_ERR
Retrieves and returns the value from this index's referenced object store that corresponds to the given key.
any getObject ( in any key ) raises (IDBDatabaseException);
any
This method can raise a IDBDatabaseException with the following code:
NOT_FOUND_ERR
Creates a cursor over the records of this index. The range of the new cursor matches the specified key range; if the key range is not specified or is null, then the range includes all the records.
void openCursor ( in optional IDBKeyRange range, in optional unsigned short direction ) raises (IDBDatabaseException);
void
This method can raise an IDBDatabaseException with the following code:
NOT_FOUND_ERR
Creates a cursor over the records of this index's referenced object store, as arranged by this index. The range of the new cursor matches the specified key range; if the key range is not specified or is null, then the range includes all the records.
void openObjectCursor ( in optional IDBKeyRange range, in optional unsigned short direction ) raises (IDBDatabaseException);
void
This method can raise an IDBDatabaseException with the following code:
NOT_FOUND_ERR
Stores the given value in this index and returns the key for the stored record. If a record already exists with the given key, the record is overwritten.
any put ( in any value, in optional any key) raises (IDBDatabaseException);
Removes from this index any records that correspond to the given key.
void remove ( in any key ) raises (IDBDatabaseException);
This method can raise a DatabaseException with the following code:
NOT_FOUND_ERR
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/IDBIndexSync