This is my update aggragation
[
{
$match: {
manager_id: 4,
day_start: {
$gte: ISODate("2021-03-20"),
$lte: ISODate("2025-12-25"),
},
},
},
{
$group: {
_id: {
property_id: "$property_id",
client_id: "$client_id",
agent_id: "$agent_id",
},
impressions_count: {
$sum: 1,
},
property_community_id: {
$first: "$property_community_id",
},
},
},
{
$sort: {
impressions_count: 1,
},
},
{
$project: {
_id: 0,
property_id: "$_id.property_id",
client_id: "$_id.client_id",
agent_id: "$_id.agent_id",
impressions_count: 1,
property_community_id: 1,
},
},
]
And that is my improved explain result (Including the index that i used), the query preformance has improved a little but we still have 3740444 index keys examined.
I think my issue is with the date index, how should i create my index in this case to cover only what i need