我想转一下:
const schema = new mongoose.Schema({
requirements[{
requirement: {
type: mongoose.Schema.Types.ObjectId,
ref: "Document",
},
expires: Date
}]
})
(使用和聚合管道)。
[{
requirements: {
requirement: {_id: XXX, documentName: XXX},
expires: XXX
}
},]
谢谢!