Skip to content

IDBIndex

Values

count

Retrieves the number of records matching the given key or key range in query.

If successful, request's result will be the count. Read more on MDN

let count: (
IndexedDbTypes.idbIndex,
~query: unknown=?,
) => IndexedDbTypes.idbRequest<int>

Parameters

IndexedDbTypes.idbIndex option< unknown >

Return type

IndexedDbTypes.idbRequest< int >

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. Read more on MDN

let get: (
IndexedDbTypes.idbIndex,
unknown,
) => IndexedDbTypes.idbRequest<JSON.t>

Parameters

IndexedDbTypes.idbIndex unknown

Return type

IndexedDbTypes.idbRequest< Stdlib.JSON.t >

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. Read more on MDN

let getAll: (
IndexedDbTypes.idbIndex,
~query: unknown=?,
~count: int=?,
) => IndexedDbTypes.idbRequest<array<JSON.t>>

Parameters

IndexedDbTypes.idbIndex option< unknown > option< int >

Return type

IndexedDbTypes.idbRequest< array< Stdlib.JSON.t > >

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. Read more on MDN

let getAllKeys: (
IndexedDbTypes.idbIndex,
~query: unknown=?,
~count: int=?,
) => IndexedDbTypes.idbRequest<
array<IndexedDbTypes.idbValidKey>,
>

Parameters

IndexedDbTypes.idbIndex option< unknown > option< int >

Return type

IndexedDbTypes.idbRequest< array< IndexedDbTypes.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. Read more on MDN

let getKey: (
IndexedDbTypes.idbIndex,
unknown,
) => IndexedDbTypes.idbRequest<unknown>

Parameters

IndexedDbTypes.idbIndex unknown

Return type

IndexedDbTypes.idbRequest< unknown >

openCursor

Opens a cursor over the records matching query, ordered by direction. If query is null, all records in index are matched.

If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records. Read more on MDN

let openCursor: (
IndexedDbTypes.idbIndex,
~query: unknown=?,
~direction: IndexedDbTypes.idbCursorDirection=?,
) => IndexedDbTypes.idbRequest<unknown>

Parameters

IndexedDbTypes.idbIndex option< unknown > option< IndexedDbTypes.idbCursorDirection >

Return type

IndexedDbTypes.idbRequest< unknown >

openKeyCursor

Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in index are matched.

If successful, request's result will be an IDBCursor, or null if there were no matching records. Read more on MDN

let openKeyCursor: (
IndexedDbTypes.idbIndex,
~query: unknown=?,
~direction: IndexedDbTypes.idbCursorDirection=?,
) => IndexedDbTypes.idbRequest<unknown>

Parameters

IndexedDbTypes.idbIndex option< unknown > option< IndexedDbTypes.idbCursorDirection >

Return type

IndexedDbTypes.idbRequest< unknown >