mongoose-validate
v0.0.5
Published
Additional Validation functions for your mongoose schema.
Downloads
415
Readme
Mongoose Validate
Additional Validation functions for your mongoose schema.
Installation
Works with Mongoose 3.3.x
$ npm install git://github.com/RGBboy/mongoose-validate.git
Usage
Mongoose Validate has been written to be used directly when declaring a Mongoose Schema:
var validate = require('mongoose-validate')
, mongoose = require('mongoose')
, Schema = mongoose.Schema
, NewSchema;
NewSchema = new Schema({
email: { type: String, required: true, validate: [validate.email, 'invalid email address'] }
});
Validates an email.
To Do
- Write tests;
- Add other validation;