is there any reason this couldn't be exposed through AbstractLevelDown (and eventually up the ecosystem)
I have a rather specific use-case, where I want to seek forward (gte: X) and if the result is R > X then I want to get the immediate predecessor (P < X). In a binary-tree this would be O(1) from the current position, rather than O(log n) for a fresh search.
I suggest to try this out in leveldown (because that's the trickiest to achieve, taking its highWaterMark logic into account etc), expose in abstract-leveldown later.
leveldb appears to have the option to move to the previous entry during iteration via
prev()
https://github.com/Level/leveldown/blob/master/deps/leveldb/leveldb-1.20/db/db_iter.cc#L205is there any reason this couldn't be exposed through AbstractLevelDown (and eventually up the ecosystem)
I have a rather specific use-case, where I want to seek forward (gte: X) and if the result is
R > X
then I want to get the immediate predecessor (P < X
). In a binary-tree this would be O(1) from the current position, rather than O(log n) for a fresh search.