Skip to content
Additional validation functions for your mongoose schema.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Mongoose Validate

Additional Validation functions for your mongoose schema.

Build Status


Works with Mongoose 3.3.x

$ npm install git://


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: [, 'invalid email address'] }


Validates an email.


Validates any alpha character (a-z, A-Z).


Validates any alphanumeric character (a-z, A-Z, 0-9).


Validates any numeric character (0-9).


Validates any whole number e.g -1, 0 or 1.


Validates a postal code. The validation accepts any alphanumeric string with a single hyphen or space that is at least 3 characters in length and no more than 10 characters in length. The valid postal code format was found at


Validates a permalink. The validation accepts any lowercase alphanumeric characters and hyphens.

To Do

  • Add other validation;
Something went wrong with that request. Please try again.