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 an object is about to be created in a database.

hook(‘reading’)

Atomic CRUD hook called when an object has been read from a database and is about to be delivered to the caller.

hook(‘updating’)

Atomic CRUD hook called when an object is about to be modified in a database.

hook(‘deleting’)

Atomic CRUD hook called when an object is about to be deleted from a database.

Methods

add()

Insert an object into the 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 an 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 the store.

count()

Count all objects.

defineClass()

Define a JavaScript constructor function and map to this table.

delete()

Delete an object from the store.

each()

Iterate over all objects in the store.

filter()

Apply a JavaScript filter on all items in the object store.

get()

Retrieve an object by primary key.

limit()

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

mapToClass()

Map this table to a JavaScript constructor function.

orderBy()

Returns a Collection instance ordered by the given index.

offset()

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

put()

Replace or insert an object.

reverse()

Returns a Collection instance in reverse order of the primary key.

toArray()

Get an array containing all objects in the store.

toCollection()

Get a Collection instance containing all of the objects in the store.

update()

Apply the given changes to an existing object.

where()

Retrieve objects using a query.

See Also

Collection

Table of Contents