编译猫鼬后无法覆盖模型
不确定我在做什么错,这是我的check.js var db = mongoose.createConnection('localhost', 'event-db'); db.on('error', console.error.bind(console, 'connection error:')); var a1= db.once('open',function(){ var user = mongoose.model('users',{ name:String, email:String, password:String, phone:Number, _enabled:Boolean }); user.find({},{},function (err, users) { mongoose.connection.close(); console.log("Username supplied"+username); //doSomethingHere }) }); 这是我的insert.js var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/event-db') var user = mongoose.model('users',{ name:String, email:String, password: String, phone:Number, _enabled:Boolean }); …