I have a collection with 80 documents, each document looks like the one below. Is there a way that I can search through each document's "data" array and find any objects that have a "color" of 'red', all in one query to the mongodb database? or would I have to make 80 different queries to the mongodb database to do this?
{
_id: 'j3k1jrh123h42',
data: [
{name: 'ben', color: 'red'},
{name: 'tom', color: 'blue'},
{name: 'will', color: 'red'},
{name: 'jack', color: 'red'},
{name: 'bob', color: 'yellow'}
],
class: '8A',
lastUpdate: '12-05-2021'
}