所以我有两个模型:
第一个模型包含以下信息:
const playerSchema = new Schema({
name: String,
matches: [{
type: Object,
ref: 'Events'
}]
})
第二个模型包含以下内容:
const eventSchema = new Schema({
event_title: String,
matches: [{
first_tennis_player_name: String,
second_tennis_player_name: String,
first_tennis_player_result: String,
second_tennis_player_result: String
}]
})
我想用第二个Model的数据填充matches
。
伪代码将如下所示:
SELECT ALL TENNIS MATCHES WHERE FIRST_TENNIS_PLAYER_NAME OR SECOND_TENNIS_PLAYER_NAME IS NAME