Home

# Class goog.db.ObjectStore

Creates an IDBObjectStore wrapper object. Object stores have methods for storing and retrieving records, and are accessed through a transaction object. They also have methods for creating indexes associated with the object store. They can only be created when setting the version of the database. Should not be created directly, access object stores through transactions.

Instance Method Summary
| `add(!Object value, Object= opt_key) ⇒ !goog.async.Deferred` Adds an object to the object store. Requires that there is no object with the same key already present.
| `clear() ⇒ !goog.async.Deferred` Deletes all objects from the store.
| `createIndex(string name, string keyPath, Object= opt_parameters) ⇒ ?goog.db.Index` Creates an index in this object store. Can only be called inside the callback for the Deferred returned from goog.db.IndexedDb#setVersion.
| `deleteIndex(string name)` Deletes an index from the object store. Can only be called inside the callback for the Deferred returned from goog.db.IndexedDb#setVersion.
| `get(!Object key) ⇒ !goog.async.Deferred` Gets an object from the store. If no object is present with that key the result is {@code undefined}.
| `getAll() ⇒ !goog.async.Deferred` Gets all objects from the store and returns them as an array.
| `getIndex(string name) ⇒ ?goog.db.Index` Gets an index.
| `getName() ⇒ string`
| `insert_(string fn, string msg, !Object value, Object= opt_key) ⇒ !goog.async.Deferred` Helper function for put and add.
| `put(!Object value, Object= opt_key) ⇒ !goog.async.Deferred` Adds an object to the object store. Replaces existing objects with the same key.
| `remove(!Object key) ⇒ !goog.async.Deferred` Removes an object from the store. No-op if there is no object present with the given key.