Вы можете использовать два способа в MongoDB
1.Простой find
метод
db.getCollection('user').find({'weekDays.day' : {$in: ["Monday"]}})
2. При использовании агрегата
db.getCollection('user').aggregate([
{$unwind:'$weekDays'},
{$match : {'weekDays.day' : {$in : ['Monday']}}},
{ "$group": {
"_id": "$id",
"weekDays" : { "$push": "$weekDays" },
}},
])
3.агрегат в loopback
var collection = ModelName.getDataSource().connector.collection("myCollection");
collection.aggregate(
[
{ $unwind:'$weekDays' },
{ $match : {'weekDays.day' : {$in : ['Monday']}}},
{ "$group": { "_id": "$id", "weekDays" : { "$push": "$weekDays" }}},
],
function(err, data) {
if (err) {
} else {
console.lod(data)
});
}
}
);