DataClient
Methods
Section titled “Methods”eachPage()
Section titled “eachPage()”eachPage<
V>(query?,options?):AsyncGenerator<RecordsPage<V>,void,undefined>
Every page of a query as an async iterator. The query is captured once and replayed unchanged for each page.
Type Parameters
Section titled “Type Parameters”V = Record<string, unknown>
Parameters
Section titled “Parameters”query?
Section titled “query?”Omit<RecordsQuery, "cursor">
options?
Section titled “options?”Returns
Section titled “Returns”AsyncGenerator<RecordsPage<V>, void, undefined>
eachRecord()
Section titled “eachRecord()”eachRecord<
V>(query?,options?):AsyncGenerator<DataRecord<V>,void,undefined>
Every record a query matches, one at a time.
Type Parameters
Section titled “Type Parameters”V = Record<string, unknown>
Parameters
Section titled “Parameters”query?
Section titled “query?”Omit<RecordsQuery, "cursor">
options?
Section titled “options?”Returns
Section titled “Returns”AsyncGenerator<DataRecord<V>, void, undefined>
models()
Section titled “models()”models(
options?):Promise<ModelsResult>
The models this key may read, each with the fields it may see and what it may query. Read this before querying.
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”Promise<ModelsResult>
record()
Section titled “record()”record<
V>(key,options?):Promise<DataRecord<V> |null>
One record, or null when there is none (or the key may not read it). throwIfMissing makes that an error.
Type Parameters
Section titled “Type Parameters”V = Record<string, unknown>
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<DataRecord<V> | null>
recordResponse()
Section titled “recordResponse()”recordResponse<
V>(key,options?):Promise<RecordResponse<V>>
The primitive under record: keeps the ETag, and sends If-None-Match when given, so an unchanged record is notModified.
Type Parameters
Section titled “Type Parameters”V = Record<string, unknown>
Parameters
Section titled “Parameters”string
options?
Section titled “options?”RecordOptions & CallOptions & object
Returns
Section titled “Returns”Promise<RecordResponse<V>>
records()
Section titled “records()”records<
V>(query?,options?):Promise<RecordsPage<V>>
One page of records.
Type Parameters
Section titled “Type Parameters”V = Record<string, unknown>
Parameters
Section titled “Parameters”query?
Section titled “query?”options?
Section titled “options?”Returns
Section titled “Returns”Promise<RecordsPage<V>>
recordsByKeys()
Section titled “recordsByKeys()”recordsByKeys<
V>(keys,expansion?,options?):Promise<BatchResult<V>>
Up to 50 records by key in one round trip, in the order asked; the keys that could not be read are in missing.
Type Parameters
Section titled “Type Parameters”V = Record<string, unknown>
Parameters
Section titled “Parameters”readonly string[]
expansion?
Section titled “expansion?”options?
Section titled “options?”Returns
Section titled “Returns”Promise<BatchResult<V>>