Calculating median with MongoDB’s aggregation pipeline
Finding the minimum, maximum or average values using a MongoDB aggregation is fairly easy, since it has built-in pipeline operators like $min
, $max
, and $avg
respectively. In many cases, however, these values do not describe the given…