const results = await Model.aggregate([
{
$match: {
id: {
$in: ['someid']
},
'foo.bar': true,
'foo.baz': true
}
}
]).exec()
// Use $elemMatch
Model.findOne({
views: {
$elemMatch: {
year: 2012,
month: 6
}
}
}, {
'views.$': 1
})