Lazyboy

A Couchdb object mapper for node.js. Removing the repeatable cruft and makes working with Couchdb as fun as it should be.

This project is maintained by garrensmith

LazyBoy: A Couchdb ODM For Node.js

Validations

Validations are done using a very good validation library: node-validation. Validation is done by creating a callback validation function on the model:

  var Mailer = Model('Mailer');

  Mailer.validate(function (check, item) {
    check(item.email).isEmail();
    check(item.name).len(0,30);
  });

When the model is saved my_model.save(function (err, item) {}) the validation will be run. If validation errors are occured and array of errors will be passed to the callback.

View the node-validation ”README” for all different types of validations you can do on the model.