为了账号安全,请及时绑定邮箱和手机立即绑定

猫鼬种群与对象嵌套

猫鼬种群与对象嵌套

海绵宝宝撒 2019-06-23 14:40:50
猫鼬种群与对象嵌套使用猫鼬种群直接包含对象?什么时候应该分别使用?猫鼬种群的例子:var personSchema = Schema({   _id     : Number,   name    : String,   stories : [{ type: Schema.Types.ObjectId, ref: 'Story' }]});var storySchema = Schema({   _creator : { type: Number, ref: 'Person' },   title    : String,});猫鼬对象嵌套示例:var personSchema = Schema({   _id     : Number,   name    : String,   stories : [storySchema]});var storySchema = Schema({   _creator : personSchema,   title    : String,});
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 563 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信