Closed tracker1 closed 5 years ago
What you want is an Iterator.
RocksDb functions like a Dictionary sorted by (the binary representation of) its keys.
An Iterator is like a cursor into an immutable snapshot of the database. It supports a "Seek" operation and a "Move Next" operation. The Seek operation will put you at the lowest key that is greater than or equal to the value you seek to. So you can seek to "/config/app/appname/", check that the key returned starts with "/config/app/appname/" and if so yield it and Move Next and repeat, and keep doing this until the key doesn't start with that prefix at which point you're reached the end.
@warrenfalk thank you, found it in the examples... Should be able to take this and get a matching Dictionary<string,string>
to return... :-)
I'm wanting to return all key/value pairs that start with a given value/bytes...
For example
/config/app/APPNAME/*
where * is anything under that common set of starting values.Sorry if this is otherwise handled, I'm really new to rocksdb and this library... looking to test this out as a replacement for another db that I'm using as a KV store that isn't well supported under ARM (specifically RPi).