貓鼬種群與對(duì)象嵌套使用貓鼬種群直接包含對(duì)象?什么時(shí)候應(yīng)該分別使用?貓鼬種群的例子:var personSchema = Schema({
_id : Number,
name : String,
stories : [{ type: Schema.Types.ObjectId, ref: 'Story' }]});var storySchema = Schema({
_creator : { type: Number, ref: 'Person' },
title : String,});貓鼬對(duì)象嵌套示例:var personSchema = Schema({
_id : Number,
name : String,
stories : [storySchema]});var storySchema = Schema({
_creator : personSchema,
title : String,});
- 1 回答
- 0 關(guān)注
- 629 瀏覽
添加回答
舉報(bào)
0/150
提交
取消