Skip to content

DbIterator

Defined in: .work/repos/olmdb/src/olmdb.ts:329

Database iterator that implements the standard TypeScript iterator protocol

  • Iterator<DbEntry<K, V>, undefined>

K

V

  • Iterator<DbEntry<K, V>, undefined>

new DbIterator<K, V>(iteratorId, convertKey, convertValue): DbIterator<K, V>

Defined in: .work/repos/olmdb/src/olmdb.ts:333

number

(buffer) => K

(buffer) => V

DbIterator<K, V>

Iterator<DbEntry<K,V>,undefined>.constructor

readonly [toStringTag]: string

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:132

Iterator.[toStringTag]

[iterator](): DbIterator<K, V>

Defined in: .work/repos/olmdb/src/olmdb.ts:340

DbIterator<K, V>

Iterator.[iterator]


next(): IteratorResult<DbEntry<K, V>>

Defined in: .work/repos/olmdb/src/olmdb.ts:351

Advances the iterator to the next key-value pair.

IteratorResult<DbEntry<K, V>>

An IteratorResult with the next DbEntry or done: true if no more entries.

With code “INVALID_ITERATOR” if iterator is invalid or already closed.

With code “LMDB-{code}” for LMDB-specific errors.

Iterator.next

Iterator.next


close(): void

Defined in: .work/repos/olmdb/src/olmdb.ts:375

Closes the iterator and frees its resources. Should be called when done iterating to prevent resource leaks.

void

With code “INVALID_ITERATOR” if iterator is invalid or already closed.


optional return(value?): IteratorResult<DbEntry<K, V>, undefined>

Defined in: site/node_modules/typescript/lib/lib.es2015.iterable.d.ts:42

undefined

IteratorResult<DbEntry<K, V>, undefined>

Iterator.return

Iterator.return


optional throw(e?): IteratorResult<DbEntry<K, V>, undefined>

Defined in: site/node_modules/typescript/lib/lib.es2015.iterable.d.ts:43

any

IteratorResult<DbEntry<K, V>, undefined>

Iterator.throw

Iterator.throw


map<U>(callbackfn): IteratorObject<U, undefined, unknown>

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:48

Creates an iterator whose values are the result of applying the callback to the values from this iterator.

U

(value, index) => U

A function that accepts up to two arguments to be used to transform values from the underlying iterator.

IteratorObject<U, undefined, unknown>

Iterator.map


filter<S>(predicate): IteratorObject<S, undefined, unknown>

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:54

Creates an iterator whose values are those from this iterator for which the provided predicate returns true.

S extends DbEntry<K, V>

(value, index) => value is S

A function that accepts up to two arguments to be used to test values from the underlying iterator.

IteratorObject<S, undefined, unknown>

Iterator.filter

filter(predicate): IteratorObject<DbEntry<K, V>, undefined, unknown>

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:60

Creates an iterator whose values are those from this iterator for which the provided predicate returns true.

(value, index) => unknown

A function that accepts up to two arguments to be used to test values from the underlying iterator.

IteratorObject<DbEntry<K, V>, undefined, unknown>

Iterator.filter


take(limit): IteratorObject<DbEntry<K, V>, undefined, unknown>

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:66

Creates an iterator whose values are the values from this iterator, stopping once the provided limit is reached.

number

The maximum number of values to yield.

IteratorObject<DbEntry<K, V>, undefined, unknown>

Iterator.take


drop(count): IteratorObject<DbEntry<K, V>, undefined, unknown>

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:72

Creates an iterator whose values are the values from this iterator after skipping the provided count.

number

The number of values to drop.

IteratorObject<DbEntry<K, V>, undefined, unknown>

Iterator.drop


flatMap<U>(callback): IteratorObject<U, undefined, unknown>

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:78

Creates an iterator whose values are the result of applying the callback to the values from this iterator and then flattening the resulting iterators or iterables.

U

(value, index) => Iterator<U, unknown, undefined> | Iterable<U, unknown, undefined>

A function that accepts up to two arguments to be used to transform values from the underlying iterator into new iterators or iterables to be flattened into the result.

IteratorObject<U, undefined, unknown>

Iterator.flatMap


reduce(callbackfn): DbEntry

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:85

Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

(previousValue, currentValue, currentIndex) => DbEntry

A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the iterator.

DbEntry

Iterator.reduce

reduce(callbackfn, initialValue): DbEntry

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:86

(previousValue, currentValue, currentIndex) => DbEntry

DbEntry

DbEntry

Iterator.reduce

reduce<U>(callbackfn, initialValue): U

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:93

Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

U

(previousValue, currentValue, currentIndex) => U

A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the iterator.

U

If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of a value from the iterator.

U

Iterator.reduce


toArray(): DbEntry<K, V>[]

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:98

Creates a new array from the values yielded by this iterator.

DbEntry<K, V>[]

Iterator.toArray


forEach(callbackfn): void

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:104

Performs the specified action for each element in the iterator.

(value, index) => void

A function that accepts up to two arguments. forEach calls the callbackfn function one time for each element in the iterator.

void

Iterator.forEach


some(predicate): boolean

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:112

Determines whether the specified callback function returns true for any element of this iterator.

(value, index) => unknown

A function that accepts up to two arguments. The some method calls the predicate function for each element in this iterator until the predicate returns a value true, or until the end of the iterator.

boolean

Iterator.some


every(predicate): boolean

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:120

Determines whether all the members of this iterator satisfy the specified test.

(value, index) => unknown

A function that accepts up to two arguments. The every method calls the predicate function for each element in this iterator until the predicate returns false, or until the end of this iterator.

boolean

Iterator.every


find<S>(predicate): S

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:129

Returns the value of the first element in this iterator where predicate is true, and undefined otherwise.

S extends DbEntry<K, V>

(value, index) => value is S

find calls predicate once for each element of this iterator, in order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined.

S

Iterator.find

find(predicate): DbEntry<K, V>

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:130

(value, index) => unknown

DbEntry<K, V>

Iterator.find


static from<T>(value): IteratorObject<T, undefined, unknown>

Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:142

Creates a native iterator from an iterator or iterable object. Returns its input if the input already inherits from the built-in Iterator class.

T

Iterator<T, unknown, undefined> | Iterable<T, unknown, undefined>

An iterator or iterable object to convert a native iterator.

IteratorObject<T, undefined, unknown>

Iterator.from


[dispose](): void

Defined in: site/node_modules/typescript/lib/lib.esnext.disposable.d.ts:34

void

Iterator.[dispose]