IDBObjectStore

The IDBObjectStore interface of the IndexedDB API represents an object store in a database.

MDN Reference

Properties

Link copied to clipboard

The autoIncrement read-only property of the for this object store.

Link copied to clipboard

The indexNames read-only property of the in this object store.

Link copied to clipboard

The keyPath read-only property of the If this property is null, the application must provide a key for each modification operation.

Link copied to clipboard

The name property of the IDBObjectStore interface indicates the name of this object store.

Link copied to clipboard

The transaction read-only property of the object store belongs.

Functions

Link copied to clipboard
fun add(value: JsAny?, key: IDBValidKey = definedExternally): IDBRequest<IDBValidKey>

The add() method of the IDBObjectStore interface returns an IDBRequest object, and, in a separate thread, creates a structured clone of the value, and stores the cloned value in the object store.

Link copied to clipboard

The clear() method of the IDBObjectStore interface creates and immediately returns an IDBRequest object, and clears this object store in a separate thread.

Link copied to clipboard

fun count(query: IDBValidKey = definedExternally): IDBRequest<JsInt>

The count() method of the IDBObjectStore interface returns an IDBRequest object, and, in a separate thread, returns the total number of records that match the provided key or of records in the store.

Link copied to clipboard
fun createIndex(name: String, keyPath: ReadonlyArray<JsString>, options: IDBIndexParameters = definedExternally): IDBIndex

fun createIndex(name: String, keyPath: String, options: IDBIndexParameters = definedExternally): IDBIndex

The createIndex() method of the field/column defining a new data point for each database record to contain.

Link copied to clipboard

The delete() method of the and, in a separate thread, deletes the specified record or records.

Link copied to clipboard
fun deleteIndex(name: String)

The deleteIndex() method of the the connected database, used during a version upgrade.

Link copied to clipboard
fun get(query: IDBKeyRange): IDBRequest<*>

fun get(query: IDBValidKey): IDBRequest<*>

The get() method of the IDBObjectStore interface returns an IDBRequest object, and, in a separate thread, returns the object selected by the specified key.

Link copied to clipboard
fun getAll(query: IDBKeyRange?, count: Int = definedExternally): IDBRequest<ReadonlyArray<*>>

fun getAll(query: IDBValidKey? = definedExternally, count: Int = definedExternally): IDBRequest<ReadonlyArray<*>>

The getAll() method of the containing all objects in the object store matching the specified parameter or all objects in the store if no parameters are given.

Link copied to clipboard
fun getAllKeys(query: IDBKeyRange?, count: Int = definedExternally): IDBRequest<ReadonlyArray<IDBValidKey>>

fun getAllKeys(query: IDBValidKey? = definedExternally, count: Int = definedExternally): IDBRequest<ReadonlyArray<IDBValidKey>>

The getAllKeys() method of the IDBObjectStore interface returns an IDBRequest object retrieves record keys for all objects in the object store matching the specified parameter or all objects in the store if no parameters are given.

Link copied to clipboard

The getKey() method of the and, in a separate thread, returns the key selected by the specified query.

Link copied to clipboard
fun index(name: String): IDBIndex

The index() method of the IDBObjectStore interface opens a named index in the current object store, after which it can be used to, for example, return a series of records sorted by that index using a cursor.

Link copied to clipboard
fun openCursor(query: IDBKeyRange?, direction: IDBCursorDirection = definedExternally): IDBRequest<IDBCursorWithValue?>

fun openCursor(query: IDBValidKey? = definedExternally, direction: IDBCursorDirection = definedExternally): IDBRequest<IDBCursorWithValue?>

The openCursor() method of the and, in a separate thread, returns a new IDBCursorWithValue object.

Link copied to clipboard
fun openKeyCursor(query: IDBKeyRange?, direction: IDBCursorDirection = definedExternally): IDBRequest<IDBCursor?>

fun openKeyCursor(query: IDBValidKey? = definedExternally, direction: IDBCursorDirection = definedExternally): IDBRequest<IDBCursor?>

The openKeyCursor() method of the whose result will be set to an IDBCursor that can be used to iterate through matching results.

Link copied to clipboard
fun put(value: JsAny?, key: IDBValidKey = definedExternally): IDBRequest<IDBValidKey>

The put() method of the IDBObjectStore interface updates a given record in a database, or inserts a new record if the given item does not already exist.