count method

Returns the number of records in an object store corresponding to a key value or key range.

Internet Explorer 10



object.count(key, retVal)


key [in, optional]

Type: any

A key value or a reference to a IDBKeyRange object.

Return value

Type: IDBRequest

The number of records matching the specified value or "0" if no matches are found.


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 a valid key value.

name: InvalidStateError
code: DOMException.INVALID_STATE_ERR (11)

The cursor underlying the request has been deleted or removed.


See also