Skip to main content

Class: ScanResult<K>#

This class is used for the results of scan. It implements AsyncIterable<JSONValue> which allows you to use it in a for await loop. There are also methods to iterate over the keys, entries or values.

Type parameters#

Name
K

Implements#

Constructors#

constructor#

+ new ScanResult<K>(...args: Args): ScanResult<K>

internal

Type parameters:#

Name
K

Parameters:#

NameType
...argsArgs

Returns: ScanResult<K>

Defined in: scan-iterator.ts:32

Methods#

[Symbol.asyncIterator]#

[Symbol.asyncIterator](): AsyncIterableIteratorToArrayWrapper<JSONValue>

The default AsyncIterable. This is the same as values.

Returns: AsyncIterableIteratorToArrayWrapper<JSONValue>

Implementation of: AsyncIterable.__@asyncIterator

Defined in: scan-iterator.ts:40


entries#

entries(): AsyncIterableIteratorToArrayWrapper<[K, JSONValue]>

Async iterator over the entries of the scan call. An entry is a tuple of key values. If the scan is over an index the key is a tuple of [secondaryKey: string, primaryKey]

Returns: AsyncIterableIteratorToArrayWrapper<[K, JSONValue]>

Defined in: scan-iterator.ts:64


keys#

keys(): AsyncIterableIteratorToArrayWrapper<K>

Async iterator over the keys of the scan call. If the scan is over an index the key is a tuple of [secondaryKey: string, primaryKey]

Returns: AsyncIterableIteratorToArrayWrapper<K>

Defined in: scan-iterator.ts:54


toArray#

toArray(): Promise<JSONValue[]>

Returns all the values as an array. Same as values().toArray()

Returns: Promise<JSONValue[]>

Defined in: scan-iterator.ts:69


values#

values(): AsyncIterableIteratorToArrayWrapper<JSONValue>

Async iterator over the valus of the scan call.

Returns: AsyncIterableIteratorToArrayWrapper<JSONValue>

Defined in: scan-iterator.ts:45