这是我的数据库的外观
{"_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 : {}
});
如何在上面的模式中声明颜色,是否正确??