level-delete-range

0.1.0 • Public • Published

level-delete-range

build status

browser support

Delete a range of keys in leveldb

Example

var level = require("levelidb")
    , after = require("after")
    , toArray = require("write-stream/array")
    , db = level("/tmp/delete-range-simple", {
        createIfMissing: true
    })
    , deleteRange = require("level-delete-range")

var next = after(3, function () {
    deleteRange(db, {
        start: "foo:"
        , end: "foo;"
    }, function (err) {
        db.readStream()
            .pipe(toArray(function (list) {
                console.log("list", list)
            }))
    })
})

db.put("foo:1", { foo: "1" }, next)
db.put("foo:2", { foo: "2" }, next)
db.put("foo:3", { foo: "3" }, next)

Installation

npm install level-delete-range

Contributors

  • Raynos

MIT Licenced

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.02latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.02

Package Sidebar

Install

npm i level-delete-range

Weekly Downloads

2

Version

0.1.0

License

none

Last publish

Collaborators

  • raynos