leveldb-rs icon indicating copy to clipboard operation
leveldb-rs copied to clipboard

How can I use prefix query

Open web3creator opened this issue 2 years ago • 1 comments

How can I use prefix query?

web3creator avatar Dec 23 '22 15:12 web3creator

Try this (and close the issue if it works, please):

  • get an iterator (https://docs.rs/rusty-leveldb/latest/rusty_leveldb/struct.DB.html#method.new_iter)
  • seek() to the prefix you are interested in (https://docs.rs/rusty-leveldb/latest/rusty_leveldb/trait.LdbIterator.html#tymethod.seek)
  • and keep iterating until the prefix changes.

dermesser avatar Jan 15 '23 08:01 dermesser