我愿就模式提出质询,但只有在问询与质相符的情况下,才有复方文件。 审议下列事项......
var EventSchema = new mongoose.Schema({
typ : { type: String },
meta : { type: String }
});
var DaySchema = new mongoose.Schema({
uid: mongoose.Schema.ObjectId,
events: [EventSchema],
dateR: { type: Date, default : Date.now }
});
function getem() {
DayModel.find({events.typ : magic }, function(err, days) {
// magic. ideally this would return a list of events rather then days
});
}
That find operation will return a list of DayModel documents. But what I d really like is a list of EventSchemas alone. Is this possible?