level-random - read random levelup values
The level-random Node.js module implements a Transform stream for reading values of random keys in levelup.
Usage
Reading values for random keys from levelup.
const encode = const leveldown = const levelup = const lr = const pipeline Readable Writable = const db = db
Run it:
$ node example.js
Types
opts()
Object
passed to Transform stream constructor.
db
The mandatory levelup instance.errorIfNotFound
Emit error if key is not foundBoolean=false
.fillCache
Fill LevelDB's LRU-cacheBoolean=false
.
Exports
level-random exports a sole function that returns a Transform stream which transforms keys to values.
var lr =
At large, of course, we leverage the lexicographical sort order of keys in log structured databases to very efficiently stream ranges. Occasionally though, we have to read randomly from the store. This module provides a value stream for arbitrary keys, ignoring non-existing keys by default.
Installation
With npm, do:
$ npm install level-random