This document describes breaking changes and how to upgrade. For a complete list of changes including minor and patch releases, please refer to the changelog.
If you are migrating from levelup
or level <= 7
to an abstract-level
database, that database will no longer have stream methods. If you previously did:
const stream = db.createReadStream(...)
You must now do:
const { EntryStream } = require('level-read-stream')
const stream = new EntryStream(db, ...)
Same goes for db.createKeyStream()
and db.createValueStream()
. If you previously did:
const keys = db.createKeyStream(...)
const values = db.createValueStream(...)
You must now do:
const { KeyStream, ValueStream } = require('level-read-stream')
const keys = new KeyStream(db, ...)
const values = new ValueStream(db, ...)
The arguments (...
in the examples above) are the same except that EntryStream
does not take keys
or values
options. If you previously did e.g.:
const keys = db.createReadStream({ keys: true, values: false })
You must now do:
const keys = new KeyStream(db)