title: LevelDB: Implementing an iterator to enumerate by key prefix
body: <p>I am looking for an efficient way to implement a key enumerator using leveldb to iterate by a key-prefix.  The key is byte array (and the db uses default byte array comparer, so all keys with specific prefix stored/retrieved sequentially), and I would like my iterator to be able to take a key prefix and return only the data with keys having that prefix.</p>
  
  <p>Do I have to use or inherit the default db iterator, seek to the first key in the range (ofcourse I need to know what it is), and then verify and return every slice that starts with the prefix (by overriding the movenext or something)? or is there a more efficient way of implementing this?</p>
  
  <p>Let me know if anybody has solved this already and can share the code or the general idea.  I am trying this from C++/CLI, but implementation in any language would help.</p>
  
  <p>Thanks.
  -raj.</p>