树数据库用于分层数据的LevelDB后端。店铺存储对象:


var db = require('levelup')('/tmp/treedb');

var tree = require('treedb')(db);

var storeOptions = {

  type: 'person',

  object: {

    name: 'Foo Bar',

    slogan: 'hello world'

  },

  callback: function(err, val) {

    console.log(val);

  }

};

tree.store(storeOptions);

输出: ['person', 'WkvBeQ1yB']

查询所有人员类型:


var pat;