Package Exports
- mongoose-regexp
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mongoose-regexp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
#mongoose-regexp
Provides Mongoose support for storing RegExp
.
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