I have a common method for updating document of any collection in MongoDB?
The following code is in file name Deleter.js
module.exports
I managed to resolve the problem like this:
var Admin; if (mongoose.models.Admin) { Admin = mongoose.model('Admin'); } else { Admin = mongoose.model('Admin', adminSchema); } module.exports = Admin;