Database

APIDatabase

Access it with:

var db = require('db');

Source

db.OBSERVABLE

Type:
Integer

Source

db.get(key, options, callback)

Parameters:
  • key — String
  • options — Integeroptional
  • callback — Function
db.set('items', [], function(){
\  db.get('items', db.OBSERVABLE, function(err, dict){
\    dict.onInserted(function(index){
\      console.log(this.get(index) + ' inserted!');
\    });
\
\    db.append('items', 'item1', function(){
\      // item1 inserted
\    });
\  });
});

Source

db.set(key, value, callback)

Parameters:
  • key — String
  • value — Any
  • callback — Functionoptional

Source

db.remove(key, value, callback)

Parameters:
  • key — String
  • value — Anyoptional
  • callback — Functionoptional

Source

db.append(key, value, callback)

Parameters:
  • key — String
  • value — Any
  • callback — Functionoptional

Source

DbList()

Extends:
List
Returns:
DbList

Source

DbList::disconnect()

Source

DbDict()

Extends:
Dict
Returns:
DbDict

Source

DbDict::disconnect()

Source