Source: https://docs.mongodb.com/manual/reference/command/mapReduce/ As of MongoDB 5.0 the map-reduce operation is deprecated. Eventually we will have to move on and migrate: https://docs.mongodb.com/manual/reference/map-reduce-to-aggregation-pipeline/