Skip to main content

Class: ScanResult<K, V>

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#

NameType
KK
Vextends ReadonlyJSONValueJSONValue

Implements#

  • AsyncIterable<V>

Constructors#

constructor#

new ScanResult<K, V>(...args)

internal

Type parameters#

NameType
KK
Vextends ReadonlyJSONValueJSONValue

Parameters#

NameType
...argsArgs

Methods#

[asyncIterator]#

[asyncIterator](): AsyncIterableIteratorToArrayWrapper<V>

The default AsyncIterable. This is the same as values.

Returns#

AsyncIterableIteratorToArrayWrapper<V>

Implementation of#

AsyncIterable.__@asyncIterator@21789


entries#

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

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


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

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

Returns#

Promise<V[]>


values#

values(): AsyncIterableIteratorToArrayWrapper<V>

Async iterator over the valus of the scan call.

Returns#

AsyncIterableIteratorToArrayWrapper<V>