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.)

Documentation IDBObjectStore by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Variables

read onlyautoIncrement:Bool

The value of the auto increment flag for this object store.

read onlyindexNames:DOMStringList

A list of the names of indexes on objects in this object store.

read onlykeyPath:Dynamic

The key path of this object store. If this attribute is null, the application must provide a key for each modification operation.

read onlyname:String

The name of this object store.

read onlytransaction:Transaction

The IDBTransaction object to which this object store belongs.

Methods

add (value:Dynamic, ?key:Dynamic):Request

Throws:

null

DOMError

clear ():Request

Throws:

null

DOMError

count (?key:Dynamic):Request

Throws:

null

DOMError

createIndex (name:String, keyPath:Array<String>, ?optionalParameters:IndexParameters):Index

createIndex (name:String, keyPath:String, ?optionalParameters:IndexParameters):Index

Throws:

null

DOMError

deleteIndex (indexName:String):Void

Throws:

null

DOMError

delete_ (key:Dynamic):Request

Throws:

null

DOMError

get (key:Dynamic):Request

Throws:

null

DOMError

getAll (?key:Dynamic, ?limit:Int):Request

Throws:

null

DOMError

getAllKeys (?key:Dynamic, ?limit:Int):Request

Throws:

null

DOMError

index (name:String):Index

Throws:

null

DOMError

openCursor (?range:Dynamic, direction:CursorDirection = "next"):Request

Throws:

null

DOMError

openKeyCursor (?range:Dynamic, direction:CursorDirection = "next"):Request

Throws:

null

DOMError

put (value:Dynamic, ?key:Dynamic):Request

Throws:

null

DOMError