JSPM

mongoose-regexp

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 502
  • Score
    100M100P100Q89820F
  • License MIT

Adds RegExp storage support to Mongoose

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.

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