This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

count

Summary

The count method returns the number of records in an object store.

Method of apis/indexeddb/IDBObjectStoreapis/indexeddb/IDBObjectStore

Syntax

var recordCount = objectStore.count(key);

Parameters

key

Data-type
DOM Node

(Optional)

A key value or a reference to a IDBKeyRange object.

Return Value

Returns an object of type NumberNumber

IDBRequest

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

Notes

The method throws and exception is

  • The transaction this IDBObjectStoreSync belongs to is not active.
  • The key parameter is not a valid key or a key range.
  • Occurs if a request is made on a source object that has been deleted or removed.

Syntax

Attributions