remodel
v0.0.4
Published
Generator-based query interface for rethinkdb.
Downloads
5
Readme
Remodel
Generator-based Models for rethinkdb.
A simple wrapper around the excellent rethinkdb, with generator support.
Installation
$ npm install remodel
Example
var remodel = require('remodel');
var reql = require('reql-then')({
host: 'localhost',
port: 28015,
db: 'test',
maxPoolSize: 10
});
// 'Users' here is the name of your table
var User = remodel(reql, 'Users');
User.findByEmail = function *(email) {
return yield User.findOne(this.r.filter({email: email}));
}
License
MIT