Module Rocksdb.Iterator
val create : t -> Options.Read_options.t -> (iterator, error) Stdlib.result
val seek : iterator -> string -> unit
seek iterator prefix
will set the iteratort
in seek mode, iterating on keys starting byprefix
val get : iterator -> (string * string) option
get iterator
will get the current key value pair on iteratort
. Calling it multiple time in a row with no change of position results in the same pair being returned
val next : iterator -> unit
next iterator
will set the iterator to the next key in the range. pair on iteratort
. Be mindful of the fact that you need to check if the iterator is still valid viais_valid
, and that according to RocksDB documentation, in prefix mode, you should make sure that the key is indeed starting by your prefix as your ending condition while iterating, since after finishing the range, RocksDB might return the next range after it. See https://github.com/facebook/rocksdb/wiki/Prefix-Seek-API-Changes#transition-to-the-new-usage
val is_valid : iterator -> bool