8
也许第二组的眼睛能看到什么是错我的架构的NodeJS - MongooseJS模式的错误,我无法弄清楚
var UserSchema = new Schema({
name:
{
first : {type: String}
, last : {type : String}
}
, password: {type: String}
, username: {type: String}
, role: RoleSchema
, created_at : {type : Date, default : Date.now}
, modified_at : {type : Date, default : Date.now}
})
var RoleSchema = {
type: [String]
, study_type: [String]
}
mongoose.model('User', UserSchema)
的错误:
TypeError: Invalid value for schema path `role`
非常感谢您的回答....我花了超过6小时在这个...... :( – Machete 2015-04-29 21:13:02