seeder.disconnect() is not a function
Closed this issue · 3 comments
joetidee commented
If I follow your example:
var seeder = require('mongoose-seed');
// Connect to MongoDB via Mongoose
seeder.connect('mongodb://localhost/sample-dev', function() {
// Load Mongoose models
seeder.loadModels([
'app/model1File.js',
'app/model2File.js'
]);
// Clear specified collections
seeder.clearModels(['Model1', 'Model2'], function() {
// Callback to populate DB once collections have been cleared
seeder.populateModels(data, function() {
seeder.disconnect();
});
});
});
I get
TypeError: seeder.disconnect is not a function
joetidee commented
Did u forget to bump to v0.3.3 or to re-publish to npm after you added the disconnect function, as I have v0.3.2 and the disconnect function does not exist in the installed module?
joetidee commented
Also, should
Seeder.prototype.disconnect = function disconnect() {
mongoose.disconnect();
};
be
Seeder.prototype.disconnect = function () {
mongoose.disconnect();
};
?
seanemmer commented
I just merged your PR and republished as 0.4.1