Mongoose如何在插入时获取index: var dbo = new DBO(); var Model = dbo.getModel(this.collectionName, this.schema); var model = new Model(this.getValue()); var user = this; model.save(function(err,model,numberAffected) { if (err) consle.log(err);
console.log('---------------------------------');
console.log(model);
console.log('---------------------------------');
user = model.get('_id');
return true;
});
为何model已经在插入后传入方法中了,为了还是无法获取_id???