count method

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

Syntax

object.count(key, retVal)

Parameters

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.

Exceptions

This method can throw the following DOMException exceptions:

Note  As of a Windows Store app using JavaScript, 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

IDBIndex
IDBObjectStore

 

 

Show:
© 2014 Microsoft