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

Readme

Keywords

none

Package Sidebar

Install

npm i level-delete-range

Weekly Downloads

2

Version

0.1.0

License

none

Last publish

Collaborators

  • raynos