MeetupSchema = new mongoose.Schema({
meeting: {type: mongoose.Schema.Types.ObjectId, ref: 'Meeting'},
eventYear: {
type: Number
},
roles: [{
_id: {type: mongoose.Schema.Types.ObjectId, ref: 'Roles', default: undefined},
personID: {type: mongoose.Schema.Types.ObjectId, ref: 'Person', default: undefined}
}],
registrationDate: {
type: Date,
default:
Date.now
},
},
{
versionKey: false
});
如何用roles
(一个对象数组,每个对象有两个引用)填充Meeting对象?