rethinkdb-ensure: 有助于确保数据库和表的存在安装没有针对它的npm包

npm install --save YChebotaev/rethinkdb-ensure

用法

var r = require('rethinkdb');

require('rethinkdb-ensure')(r);

// Monkey-patching r.connect({ db: 'test' }, function (err, conn) {

r.ensureDb('test', function (err, result) {

// result may be {created:1} or {created:0}

// at this point db `test` is created

var tabl