Collection
The WireBootstrap IndexedDB Connector's service provider can be used as a collection into IndexedDB database stores. The service provider contains methods for maintaining stores using a key into the collection.
The service provider class constructor takes the key name as the first parameter and optionally an array of data to set into IndexedDB to be maintained using the collection.
The following example creates a new instance of the service provider directly. It specifies the data to be an array of fruits
with the name
field being the key into the collection.
GetAll
To retrieve all objects from the store created above in IndexedDB, use the getAll
method.
Get
To pull a single object from the IndexedDB store, use the get
method specifying the value for the key into the collection.
Put
To add an object to the IndexedDB store, use the put
method with the object.
Delete
To remove an object from the IndexedDB store, use the delete
method specifying the key value for the object to be removed.
Last updated