collection of mongoose plugins and schemas

Usage no npm install needed!

<script type="module">
  import mongooseUtils from '';


Mongoose Utils

A collection of mongoose validations, plugins, and utilities.

var utils = require('mongoose-utils'),
    mongoose = require('mongoose');

var User = new mongoose.Schema({
  email         : { type: String, index: true, required:true, unique: true, validate: [, 'not valid'] },
  password      : { type: String, trim: true, required:true, validate: [utils.validate.length(4), 'required to be at least 4 characters'] }
}, {strict:true});

// Plugins