Aggregation Pipeline Stages
$match- Filter documents$group- Group by field$sort- Sort results$project- Select fields$lookup- Join collections
Blog.aggregate([
{ $match: { type: 'notes' } },
{ $sort: { createdAt: -1 } },
{ $limit: 10 }
]);