mongoose-update-manager
v1.0.3
Published
excecute scripts once in a specific folder and log the updates
Downloads
1
Maintainers
Readme
mongoose-update-manager
Installation
$ npm install mongoose-update-manager
Usage
// index.js
var path = require('path')
var mongoose = require('mongoose')
var updates = require('mongoose-update-manager')
mongoose.Promise = global.Promise
mongoose.connect('mongodb://localhost/mongoose-update-manager', {
useMongoClient: true
})
updates(path.join(__dirname, 'updates'))
create a new file: updates/example-0.0.1.js
// example-0.0.1.js
var User = require('../user-model')
new User({
username: 'myname',
password: 'mypassword'
}).save()
example-0.0.1.js
execude only one time.
a new update could have the name example-0.0.2.js
or other-example-0.0.1.js