I'm querying an object from a collection that has a key with an array of objects. I want it to return the object and exclude the elements in the array that have "available: false".
Ex:
{
name: "Willy's Store",
city: "Baigorria",
storeId:"666",
open: [
{day: monday, available: true},
{day: tuesday, available:true},
{day:wensday, available: true},
{day:thursday, available:false},
{day:friday, available:false}
]
}
on the query, the expected result should be
{
name: "Willy's Store",
city: "Baigorria",
storeId:"666",
open: [
{day: monday, available: true},
{day: tuesday, available:true},
{day:wensday, available: true}
]
}
I want to only use mongoose to achieve it