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.)
To determine if the add operation has completed successfully, listen for the transaction’s complete event in addition to the IDBObjectStore.add request’s success event, because the transaction may still fail after the success event fires. In other words, the success event is only triggered when the transaction has been successfully queued.
Clearing an object store consists of removing all records from the object store and removing all records in indexes that reference the object store.
An IDBRequest object on which subsequent events related to this operation are fired.
Note that this method must be called only from a VersionChange transaction mode callback.
Note that this method must be called only from a VersionChange transaction mode callback. Note that this method synchronously modifies the IDBObjectStore.indexNames property.
If a value is successfully found, then a structured clone of it is created and set as the result of the request object.
If a value is successfully found, then a structured clone of it is created and set as the result of the request object.
If a value is successfully found, then a structured clone of it is created and set as the result of the request object.
If this property is null, the application must provide a key for each modification operation.
To determine if the add operation has completed successfully, listen for the results’s success event.
To determine if the add operation has completed successfully, listen for the results’s success event.
If the record is successfully stored, then a success event is fired on the returned request object with the result set to the key for the stored record, and the transaction set to the transaction in which this object store is opened.