小编幻影枫*_*影枫韵的帖子

一个属性的mongoose schema multi ref

如何为一个mongoose模式的一个属性编写多个ref,就像这样(但是错误的):

var Schema = mongoose.Schema;
var PeopleSchema = new Schema({
    peopleType:{
        type: Schema.Types.ObjectId,
        ref: ['A', 'B'] /*or 'A, B'*/
    }
})
Run Code Online (Sandbox Code Playgroud)

schema ref mongoose mongodb

11
推荐指数
2
解决办法
3164
查看次数

标签 统计

mongodb ×1

mongoose ×1

ref ×1

schema ×1