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: (
WebAPI.IndexedDBAPI.idbIndex,
~query: WebAPI.Prelude.any=?,
) => WebAPI.IndexedDBAPI.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: (
WebAPI.IndexedDBAPI.idbIndex,
WebAPI.Prelude.any,
) => WebAPI.IndexedDBAPI.idbRequest<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: (
WebAPI.IndexedDBAPI.idbIndex,
~query: WebAPI.Prelude.any=?,
~count: int=?,
) => WebAPI.IndexedDBAPI.idbRequest<array<JSON.t>>

Parameters

WebAPI.IndexedDBAPI.idbIndex option< WebAPI.Prelude.any > option< int >

Return type

WebAPI.IndexedDBAPI.idbRequest< array< 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: (
WebAPI.IndexedDBAPI.idbIndex,
~query: WebAPI.Prelude.any=?,
~count: int=?,
) => WebAPI.IndexedDBAPI.idbRequest<
array<WebAPI.IndexedDBAPI.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: (
WebAPI.IndexedDBAPI.idbIndex,
WebAPI.Prelude.any,
) => WebAPI.IndexedDBAPI.idbRequest<WebAPI.Prelude.any>

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: (
WebAPI.IndexedDBAPI.idbIndex,
~query: WebAPI.Prelude.any=?,
~direction: WebAPI.IndexedDBAPI.idbCursorDirection=?,
) => WebAPI.IndexedDBAPI.idbRequest<WebAPI.Prelude.any>

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: (
WebAPI.IndexedDBAPI.idbIndex,
~query: WebAPI.Prelude.any=?,
~direction: WebAPI.IndexedDBAPI.idbCursorDirection=?,
) => WebAPI.IndexedDBAPI.idbRequest<WebAPI.Prelude.any>