The Table class represents an IDBObjectStore.

Properties

name

The name of the object store represented by this Table instance.

schema

The table schema of this object store.

Events

hook(‘creating’)

Atomic CRUD hook called when object is about to be created in db.

hook(‘reading’)

Atomic CRUD hook called when object has been read from db and is about to be delivered to caller.

hook(‘updating’)

Atomic CRUD hook called when object is about to be modified in db.

hook(‘deleting’)

Atomic CRUD hook called when object is about to be deleted from db.

Methods

add()

Insert an object into store.

bulkAdd()

Same as add() but takes array arguments and is optimized for adding a large number of objects.

bulkDelete()

Same as delete() but takes and array of keys and is optimized for deleting a large number of objects.

bulkPut()

Same as put() but takes array arguments and is optimized for putting a large number of objects.

clear()

Clear all objects in store.

count()

Count all objects.

defineClass()

Define a javascript constructor function and map to this table.

delete()

Delete an object from store.

each()

Iterate all objects in store.

filter()

Apply javascript filter on all items in the object store

get()

Retrieve object by primary key.

limit()

Return a Collection ordered by primary key, limited to N items.

mapToClass()

Map this table to javascript constructor function.

orderBy()

Returns a Collection instance ordered by given index.

offset()

Return a Collection ordered by primary key, where the first N items in the table are ignored.

put()

Replace or insert object.

reverse()

Returns a Collection instance with reversed order of the primary key.

toArray()

Get an array containing all objects in store.

toCollection()

Get a Collection containing all objects in store.

update()

Apply given changes to an existing object.

where()

Retrieve objects using a query.

See Also

Collection

Table of Contents