Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IDBObjectStore

Hierarchy

  • IDBObjectStore

Index

Properties

autoIncrement

autoIncrement: boolean

Returns true if the store has a key generator, and false otherwise.

indexNames

indexNames: DOMStringList

Returns a list of the names of indexes in the store.

keyPath

keyPath: string | string[]

Returns the key path of the store, or null if none.

name

name: string

Updates the name of the store to newName. Throws "InvalidStateError" DOMException if not called within an upgrade transaction.

transaction

transaction: IDBTransaction

Returns the associated transaction.

Methods

add

clear

  • Deletes all records in store. If successful, request's result will be undefined.

    Returns IDBRequest<undefined>

count

  • Retrieves the number of records matching the given key or key range in query. If successful, request's result will be the count.

    Parameters

    Returns IDBRequest<number>

createIndex

  • Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException. Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.

    Parameters

    Returns IDBIndex

delete

  • Deletes records in store with the given key or in the given key range in query. If successful, request's result will be undefined.

    Parameters

    Returns IDBRequest<undefined>

deleteIndex

  • deleteIndex(name: string): void
  • Deletes the index in store with the given name. Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.

    Parameters

    • name: string

    Returns void

get

  • Retrieves the value of the first record matching the given key or key range in query. If successful, request's result will be the value, or undefined if there was no matching record.

    Parameters

    Returns IDBRequest<any | undefined>

getAll

  • Retrieves the values of the records matching the given key or key range in query (up to count if given). If successful, request's result will be an Array of the values.

    Parameters

    Returns IDBRequest<any[]>

getAllKeys

  • Retrieves the keys of records matching the given key or key range in query (up to count if given). If successful, request's result will be an Array of the keys.

    Parameters

    Returns IDBRequest<IDBValidKey[]>

getKey

  • Retrieves the key of the first record matching the given key or key range in query. If successful, request's result will be the key, or undefined if there was no matching record.

    Parameters

    Returns IDBRequest<IDBValidKey | undefined>

index

  • Parameters

    • name: string

    Returns IDBIndex

openCursor

  • Opens a cursor over the records matching query, ordered by direction. If query is null, all records in store are matched. If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records.

    Parameters

    Returns IDBRequest<IDBCursorWithValue | null>

openKeyCursor

  • Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched. If successful, request's result will be an IDBCursor pointing at the first matching record, or null if there were no matching records.

    Parameters

    Returns IDBRequest<IDBCursor | null>

put

Generated using TypeDoc