嗯,我是mongodb / mongoose的新手,所以这些概念在我的脑海中仍然有些混乱。谁能解释一下以下几点之间的区别:
var PersonSchema = new Schema({
name : String,
groups: [{ type: Schema.ObjectId, ref: 'Group' }]
});
和
var GroupsSchema = new Schema({
name : String
});
var PersonSchema = new Schema({
name : String,
groups : [GroupsSchema ]
});
谢谢!