Skip to content

createIterator

const createIterator: (transactionId, startKey?, endKey?, reverse?) => number

Defined in: .work/repos/olmdb/src/lowlevel.ts:137

Creates an iterator for scanning a range of keys within a transaction.

The iterator covers the half-open range [startKey, endKey)startKey is the inclusive lower bound and endKey the exclusive upper bound. This holds regardless of direction: reverse only changes the order in which keys are emitted, not which bound is inclusive. So a forward scan yields the range ascending starting at startKey, while a reverse scan yields the same range descending starting at the largest key below endKey.

number

The ID of the transaction

ArrayBufferLike

Optional inclusive lower bound (defaults to the first key)

ArrayBufferLike

Optional exclusive upper bound (defaults to past the last key)

boolean

If true, keys are returned in descending order

number

An iterator ID to be used with readIterator() and closeIterator()

DatabaseError if the operation fails