Am I doing something wrong here? I always get a timeout everytime I do this query
const propAggregate = await PropertyModel.aggregate([
{
$match: { floors: { $gte: 10 } }
},
{
$group: {
_id: { $toUpper: '$propertyType' },
maxPrice: { $max: '$price' }
}
},
{
$sort: {
maxPrice: 1
}
},
]);