@abskmj/mongen
v1.0.0
Published
It is a helper script to organise and initialize mongoose schemas, functions/methods and plugins.
Downloads
4
Readme
Mongen
It is a helper script to organise and initialize mongoose schemas, functions/methods and plugins. You can take a look at examples to get started.
let mongen = require("@abskmj/mongen");
mongen.init({
mongo:'mongodb://<user>:<password>@localhost:27017/test',
path: __dirname + '/models'
}, (error, mongoose) =>{
let User = mongoose.model('User');
let user = new User({
name: "ABC",
email: "[email protected]"
});
console.log(user.toJSON());
});