M
Size: a a a
M
A
NS

x
SS
const Shop = await this.shopModel.aggregate([
{
$match: { shop },
},
{
$lookup: {
from: 'products',
localField: 'shop',
foreignField: 'shop',
as: 'products',
},
},
])
const Categories = await this.productModel.aggregate([
{
$match:{ shop }
},
{
$project: { category: 1 }
},
{ $unwind: "$category" },
{ $group: {
_id: '$category' ,
count: { $sum: 1 }
}
}
])
A
DL
A
A
ГЗ
FV
DL
B
FV
DL
DL
FV
DL
FV
FV