mongoose-regexp

Adds RegExp storage support to Mongoose

npm install mongoose-regexp
10 downloads in the last week
57 downloads in the last month

mongoose-regexp

=================

Provides Mongoose support for storing RegExp.

Build Status

Example:

var mongoose = require('mongoose')
require('mongoose-regexp')(mongoose);

var mySchema = Schema({ reg: RegExp });
var M = mongoose.model('RegExp', mySchema);

var m = new M;
m.reg = /^mongodb/i;
m.save(function (err) {
  M.findById(m._id, function (err, doc) {
    var ok = m.reg.test("MongoDB allows storing RegExps!");
    console.log(ok); // true
  });
});

install

npm install mongoose-regexp

LICENSE

npm loves you