DbIterator
Defined in: .work/repos/olmdb/src/olmdb.ts:329
Database iterator that implements the standard TypeScript iterator protocol
Extends
Section titled “Extends”Iterator<DbEntry<K,V>,undefined>
Type Parameters
Section titled “Type Parameters”K
V
Implements
Section titled “Implements”Iterator<DbEntry<K,V>,undefined>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DbIterator<
K,V>(iteratorId,convertKey,convertValue):DbIterator<K,V>
Defined in: .work/repos/olmdb/src/olmdb.ts:333
Parameters
Section titled “Parameters”iteratorId
Section titled “iteratorId”number
convertKey
Section titled “convertKey”(buffer) => K
convertValue
Section titled “convertValue”(buffer) => V
Returns
Section titled “Returns”DbIterator<K, V>
Overrides
Section titled “Overrides”Iterator<DbEntry<K,V>,undefined>.constructor
Properties
Section titled “Properties”[toStringTag]
Section titled “[toStringTag]”
readonly[toStringTag]:string
Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:132
Inherited from
Section titled “Inherited from”Iterator.[toStringTag]
Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”[iterator]():
DbIterator<K,V>
Defined in: .work/repos/olmdb/src/olmdb.ts:340
Returns
Section titled “Returns”DbIterator<K, V>
Overrides
Section titled “Overrides”Iterator.[iterator]
next()
Section titled “next()”next():
IteratorResult<DbEntry<K,V>>
Defined in: .work/repos/olmdb/src/olmdb.ts:351
Advances the iterator to the next key-value pair.
Returns
Section titled “Returns”IteratorResult<DbEntry<K, V>>
An IteratorResult with the next DbEntry or done: true if no more entries.
Throws
Section titled “Throws”With code “INVALID_ITERATOR” if iterator is invalid or already closed.
Throws
Section titled “Throws”With code “LMDB-{code}” for LMDB-specific errors.
Implementation of
Section titled “Implementation of”Iterator.next
Overrides
Section titled “Overrides”Iterator.next
close()
Section titled “close()”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.
Returns
Section titled “Returns”void
Throws
Section titled “Throws”With code “INVALID_ITERATOR” if iterator is invalid or already closed.
return()?
Section titled “return()?”
optionalreturn(value?):IteratorResult<DbEntry<K,V>,undefined>
Defined in: site/node_modules/typescript/lib/lib.es2015.iterable.d.ts:42
Parameters
Section titled “Parameters”value?
Section titled “value?”undefined
Returns
Section titled “Returns”IteratorResult<DbEntry<K, V>, undefined>
Implementation of
Section titled “Implementation of”Iterator.return
Inherited from
Section titled “Inherited from”Iterator.return
throw()?
Section titled “throw()?”
optionalthrow(e?):IteratorResult<DbEntry<K,V>,undefined>
Defined in: site/node_modules/typescript/lib/lib.es2015.iterable.d.ts:43
Parameters
Section titled “Parameters”any
Returns
Section titled “Returns”IteratorResult<DbEntry<K, V>, undefined>
Implementation of
Section titled “Implementation of”Iterator.throw
Inherited from
Section titled “Inherited from”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.
Type Parameters
Section titled “Type Parameters”U
Parameters
Section titled “Parameters”callbackfn
Section titled “callbackfn”(value, index) => U
A function that accepts up to two arguments to be used to transform values from the underlying iterator.
Returns
Section titled “Returns”IteratorObject<U, undefined, unknown>
Inherited from
Section titled “Inherited from”Iterator.map
filter()
Section titled “filter()”Call Signature
Section titled “Call Signature”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.
Type Parameters
Section titled “Type Parameters”S extends DbEntry<K, V>
Parameters
Section titled “Parameters”predicate
Section titled “predicate”(value, index) => value is S
A function that accepts up to two arguments to be used to test values from the underlying iterator.
Returns
Section titled “Returns”IteratorObject<S, undefined, unknown>
Inherited from
Section titled “Inherited from”Iterator.filter
Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”predicate
Section titled “predicate”(value, index) => unknown
A function that accepts up to two arguments to be used to test values from the underlying iterator.
Returns
Section titled “Returns”IteratorObject<DbEntry<K, V>, undefined, unknown>
Inherited from
Section titled “Inherited from”Iterator.filter
take()
Section titled “take()”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.
Parameters
Section titled “Parameters”number
The maximum number of values to yield.
Returns
Section titled “Returns”IteratorObject<DbEntry<K, V>, undefined, unknown>
Inherited from
Section titled “Inherited from”Iterator.take
drop()
Section titled “drop()”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.
Parameters
Section titled “Parameters”number
The number of values to drop.
Returns
Section titled “Returns”IteratorObject<DbEntry<K, V>, undefined, unknown>
Inherited from
Section titled “Inherited from”Iterator.drop
flatMap()
Section titled “flatMap()”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.
Type Parameters
Section titled “Type Parameters”U
Parameters
Section titled “Parameters”callback
Section titled “callback”(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.
Returns
Section titled “Returns”IteratorObject<U, undefined, unknown>
Inherited from
Section titled “Inherited from”Iterator.flatMap
reduce()
Section titled “reduce()”Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”callbackfn
Section titled “callbackfn”(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.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Iterator.reduce
Call Signature
Section titled “Call Signature”reduce(
callbackfn,initialValue):DbEntry
Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:86
Parameters
Section titled “Parameters”callbackfn
Section titled “callbackfn”(previousValue, currentValue, currentIndex) => DbEntry
initialValue
Section titled “initialValue”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Iterator.reduce
Call Signature
Section titled “Call Signature”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.
Type Parameters
Section titled “Type Parameters”U
Parameters
Section titled “Parameters”callbackfn
Section titled “callbackfn”(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.
initialValue
Section titled “initialValue”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.
Returns
Section titled “Returns”U
Inherited from
Section titled “Inherited from”Iterator.reduce
toArray()
Section titled “toArray()”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.
Returns
Section titled “Returns”DbEntry<K, V>[]
Inherited from
Section titled “Inherited from”Iterator.toArray
forEach()
Section titled “forEach()”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.
Parameters
Section titled “Parameters”callbackfn
Section titled “callbackfn”(value, index) => void
A function that accepts up to two arguments. forEach calls the callbackfn function one time for each element in the iterator.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Iterator.forEach
some()
Section titled “some()”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.
Parameters
Section titled “Parameters”predicate
Section titled “predicate”(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.
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”Iterator.some
every()
Section titled “every()”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.
Parameters
Section titled “Parameters”predicate
Section titled “predicate”(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.
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”Iterator.every
find()
Section titled “find()”Call Signature
Section titled “Call Signature”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.
Type Parameters
Section titled “Type Parameters”S extends DbEntry<K, V>
Parameters
Section titled “Parameters”predicate
Section titled “predicate”(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.
Returns
Section titled “Returns”S
Inherited from
Section titled “Inherited from”Iterator.find
Call Signature
Section titled “Call Signature”find(
predicate):DbEntry<K,V>
Defined in: site/node_modules/typescript/lib/lib.es2025.iterator.d.ts:130
Parameters
Section titled “Parameters”predicate
Section titled “predicate”(value, index) => unknown
Returns
Section titled “Returns”DbEntry<K, V>
Inherited from
Section titled “Inherited from”Iterator.find
from()
Section titled “from()”
staticfrom<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.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”Iterator<T, unknown, undefined> | Iterable<T, unknown, undefined>
An iterator or iterable object to convert a native iterator.
Returns
Section titled “Returns”IteratorObject<T, undefined, unknown>
Inherited from
Section titled “Inherited from”Iterator.from
[dispose]()
Section titled “[dispose]()”[dispose]():
void
Defined in: site/node_modules/typescript/lib/lib.esnext.disposable.d.ts:34
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Iterator.[dispose]