Shaping the Report: $project, $set, $sort and $limit

Four stages turn a pipeline's correct answer into a report someone can read, $sort and $limit for the top few, $project to choose and rename fields, and $set to compute new ones with expressions such as $multiply and $round, and the order of the stages changes what comes out.

By

Updated

Cheat sheet: Shaping the Report: $project, $set, $sort and $limit
Category
MongoDB
Level
Journeyman
Tags
$project, $set and $addFields, Aggregation Expression, mongodb, sort, limit and skip