0.0.5 • Published 11 years ago

mongoose-validate v0.0.5

Weekly downloads
251
License
-
Repository
-
Last release
11 years ago

Mongoose Validate

Additional Validation functions for your mongoose schema.

Build Status

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'] }
});

Email

Validates an email.

To Do

  • Write tests;
  • Add other validation;