getKey method

Retrieves the key value from an index.

Internet Explorer 10



var retVal = IDBIndex.getKey(key);


key [in]

Type: any

The value to search for or a reference to a key range object that specifies a range of values to search.

Return value

Type: IDBRequest

The value found or "undefined" if the value specified for the key parameter was not found in the index. If the value specified for the key parameter is a key range, the first match, as ordered by the index, is returned.


This method can throw the following DOMException exceptions:

Note  As of Internet Explorer 10, the code property is deprecated in favor of the name property, which is preferred for standards compliance and future compatibility.
Exception propertiesCondition
name: DataError

The value specified for the key parameter is not valid.

name: InvalidStateError
code: DOMException.INVALID_STATE_ERR (11)

The data source has been deleted or is otherwise not available.

name: TransactionInactiveError

The associated transaction is not active.


Standards information

See also