IndexedDB objects
The IndexedDB API consists of several objects, each designed for specific tasks. Each object is listed here:
- Data is stored in object stores, which are collections of JavaScript objects whose attributes contain individual values.
- Each JavaScript object, sometimes called a record, in an object store has a common attribute called a key path; the value of this attribute is called a key value (or key). Key values uniquely identify individual records within an object store.
- An index organizes objects according to the value of a common attribute. Indexes return sets of key values that can be used to obtain the individual records from the original object store.
- A cursor represents a set of values. When an index defines a cursor, the cursor represents the set of key values returned by the index. When an object store defines a cursor, the cursor represents a set of records stored in the cursor.
- A keyRange defines a range of values for an index or a set of records in an object store; key ranges allow you to filter cursor results.
- A database contains the object stores and indexes; databases also manage transactions.
- A request represents individual actions taken against objects in a database. For example, opening a database leads to a request object and you define event handlers on the request object to react to the results of the request.
- A transaction manages the context of operations and is used to maintain the integrity of database activities. For example, you can create object stores only in the context of a version change transaction. If a transaction is aborted, all operations within the transaction are canceled.