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)

internal

Type parameters#

Name
K

Parameters#

NameType
...argsArgs

Methods#

[asyncIterator]#

[asyncIterator](): AsyncIterableIteratorToArrayWrapper<JSONValue>

The default AsyncIterable. This is the same as values.

Returns#

AsyncIterableIteratorToArrayWrapper<JSONValue>

Implementation of#

AsyncIterable.__@asyncIterator@21782


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]>


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>


toArray#

toArray(): Promise<JSONValue[]>

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

Returns#

Promise<JSONValue[]>


values#

values(): AsyncIterableIteratorToArrayWrapper<JSONValue>

Async iterator over the valus of the scan call.

Returns#

AsyncIterableIteratorToArrayWrapper<JSONValue>