IDBObjectStore
This example shows a variety of different uses of object stores, from updating the data structure with IDBObjectStore.createIndex inside an onupgradeneeded function, to adding a new item to our object store with IDBObjectStore.add. For a full working example, see our To-do Notifications app (view example live.)
Properties
Functions
Adds or updates a record in store with the given value and key.
Deletes all records in store.
Retrieves the number of records matching the given key or key range in query.
Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException.
Deletes records in store with the given key or in the given key range in query.
Deletes the index in store with the given name.
Retrieves the value of the first record matching the given key or key range in query.
Retrieves the values of the records matching the given key or key range in query (up to count if given).
Retrieves the keys of records matching the given key or key range in query (up to count if given).
Retrieves the key of the first record matching the given key or key range in query.
Opens a cursor over the records matching query, ordered by direction. If query is null, all records in store are matched.
Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched.
Adds or updates a record in store with the given value and key.