basically I'm trying to create a boolean field "focus" in a query that is true if a field "focusStores" contains a certain store.
Example: If a product as the following focus stores - ["AAA","BBB"] and if I'm using the store "AAA" as a search criteria the focus field should be true.
This is currently my best try. Any help would be appreciated!
db.getCollection('Products').aggregate([
{
$project: {
sku: 1,
focusStores : 1,
focusTmp : {$focusStores: {$in : 'AAA'}}
}
}
])