From this 'houses' collection
{
_id: "0",
rooms: [
{
roomName: "living-room"
chairs: "6"
},
{
roomName: "kitchen"
chairs: "0"
}
]
}
I need to find the house with _id = 0, and select only the 'chairs' from the "living-room" so that the result looks like this:
{
chairs: 6
}
I think of something that looks like this:
House.findOne({_id: '0'}).select('rooms.chairs') // but only from {roomName: "living-room"}
How do I complete the query?