Issue in Aggregate response time

Try to put the { $sort: { createdAt: -1 } } stage after the $match, see Aggregation Pipeline Optimization - Database Manual - MongoDB Docs