Class: DBTable

DBTable

This simulates table operation in LOWDB

new DBTable(lowdb, string,, string,)

Parameters:
Name Type Description
lowdb db instance
string, column table name
string, key the key in record to uniquely identify the record
Source:
db/table.js

Methods


size()

Return length of table
Source:
db/table.js

insert()

Insert a record, the record must have 'key' in itself.
Source:
db/table.js

delete()

Delete a record identified by id
Source:
db/table.js

update()

Update a record identified by id, the new record must have 'key'.
Source:
db/table.js

read()

Read a record identified by id
Source:
db/table.js

truncate()

truncte table
Source:
db/table.js

filter(function)

Filter the records.
Parameters:
Name Type Description
function f signature (record)=>bool
Source:
db/table.js
Returns:
Type
array