Skip to content

TableSchema

David Fahlander edited this page Apr 15, 2014 · 9 revisions

Syntax

db.table(tableName).schema

Properties

name : String

The name of the object store.

primKey : IndexSpec

Specification of primary key.

indexes : Array<IndexSpec>

List of indexes properties.

instanceTemplate : Object

Object populated with indexed properties. Used for helping out IDE with code completion.

mappedClass : Function

In case Table.defineClass() or Table.mapToClass() has been used, the mapped constructor function will be stored in this property.

Description

Primary key and indexes for the object store (Table).

Sample

var db = new Dexie("MyDB");
db.version(1).stores({friends: "++id,name"});

alert ("Primary key: " + db.friends.schema.primKey.keyPath); // Will alert ("id");
Clone this wiki locally