Level-2i, Secondary Indexes for Level
Creates and manages indexes and totals for your keys atomically, allowing you to look up keys by their secondary indexes. Indexes are kept up to date as you update the value.
Wrap LevelUp
var Level2i = ;var mydb = ;
Put with indexes
mydb;
Look up indexed values
var fritzyresults = mydb;
Find out how many indexed values you have
mydb.getIndexValueTotal('name_bin', 'fritzy', function (err, total) {
console.log("There are %d fritzys!" % total);
});
Kept up to date!
- Every put replaces the indexes with what you specify
- Deleting a key removes it from the results
- Counts are kept accurate