mongoose-mass-assign
v0.4.0
Published
A mongoose plugin to help safely perform mass assignments from web input
Downloads
16
Readme
Usage
An example
var massAssign = require('mongoose-mass-assignment');
var UserSchema = new mongoose.Schema({
name : String,
admin : { type: Boolean, protect: true, default: false },
verified : { type: Boolean, protect: true, default: false }
});
UserSchema.plugin(massAssign);
var User = mongoose.model('User', UserSchema);
For more details see test.js
Testing
npm install
make test