Class: LowlevelUp

db.LowlevelUp

new LowlevelUp(file, options)

Extremely low-level version of levelup. The only levelup feature it provides is error-wrapping. It gives a nice recallable open() method and event. It assumes ascii keys and binary values.

This avoids pulling in extra deps and lowers memory usage.

Parameters:
Name Type Description
file String

Location.

options Object

Leveldown options.

Source:

Methods

approximateSize(start, end) → {Promise}

Calculate approximate database size.

Parameters:
Name Type Description
start String

Start key.

end String

End key.

Source:
Returns:
  • Returns Number.
Type
Promise

backup(path) → {Promise}

Backup the database.

Parameters:
Name Type Description
path String
Source:
Returns:
Type
Promise

batch(opsnullable) → {Batch}

Create an atomic batch.

Parameters:
Name Type Attributes Description
ops Array <nullable>
Source:
Returns:
Type
Batch

checkVersion(version) → {Promise}

Write and assert a version number for the database.

Parameters:
Name Type Description
version Number
Source:
Returns:
Type
Promise

clone(path) → {Promise}

Clone the database.

Parameters:
Name Type Description
path String
Source:
Returns:
Type
Promise

del(key) → {Promise}

Remove a record from the database.

Parameters:
Name Type Description
key String | Buffer
Source:
Returns:
Type
Promise

destroy() → {Promise}

Destroy the database.

Source:
Returns:
Type
Promise

dump() → {Promise}

Dump database (for debugging).

Source:
Returns:
  • Returns Object.
Type
Promise

get(key) → {Promise}

Retrieve a record from the database.

Parameters:
Name Type Description
key String | Buffer
Source:
Returns:
  • Returns Buffer.
Type
Promise

getProperty(name) → {String}

Get a database property.

Parameters:
Name Type Description
name String

Property name.

Source:
Returns:
Type
String

has(key) → {Promise}

Test whether a key exists.

Parameters:
Name Type Description
key String
Source:
Returns:
  • Returns Boolean.
Type
Promise

iterator(options) → {Iterator}

Create an iterator.

Parameters:
Name Type Description
options Object
Source:
Returns:
Type
Iterator

keys(options) → {Promise}

Collect all keys from iterator options.

Parameters:
Name Type Description
options Object

Iterator options.

Source:
Returns:
  • Returns Array.
Type
Promise

put(key, value) → {Promise}

Store a record in the database.

Parameters:
Name Type Description
key String | Buffer
value Buffer
Source:
Returns:
Type
Promise

range(options) → {Promise}

Collect all keys from iterator options.

Parameters:
Name Type Description
options Object

Iterator options.

Source:
Returns:
  • Returns Array.
Type
Promise

repair() → {Promise}

Repair the database.

Source:
Returns:
Type
Promise

values(options) → {Promise}

Collect all keys from iterator options.

Parameters:
Name Type Description
options Object

Iterator options.

Source:
Returns:
  • Returns Array.
Type
Promise