用于双语的猫鼬模式

时间:2017-04-30 13:52:46

标签: node.js mongoose mongoose-schema

  

这是我的数据库的外观

{"_id" : ObjectId("5905d84ea1b895165b28a2d6"), "name" : "risk", "email" : "hyuji@gmail.com", "cgpa" : "9", "stream" : "uio", "password" : "password", "registered" : [ "reg1", "reg2"], "color" : {"reg1":1, "reg2":2}

}

现在我需要为它编写一个模式

var studentDataSchema = new Schema({
name : String,
email : String,
cgpa : Number,
stream : String,
password : String,
registered : [],
color : {}

});

如何在上面的模式中声明颜色,是否正确??

0 个答案:

没有答案