O'Reilly logo

Getting Started with LevelDB by Andy Dent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Iteration and Searching Keys

Chapter 3, Basic Key-value Operations Creating and Deleting Data, found that Put, Get, and Delete values by keys was all we needed, but some way of getting more than one value back at a time is generally very useful. If you don't know what data may be in your keys, then you need a way to search for partial matches or just start from the beginning of the database. This ability to search for and iterate through keys in sorted order is what completes LevelDB's ability to be the foundation of a database. The default sorting order is a BytewiseComparator, effectively ASCII.

Introducing Sample04 to show you loops and searches

Sample04 uses the same LevelDbHelpers.h as before. Please download the entire sample ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required