mongodb MapReduce 和聚合管道哪个更好用?

In mongodb Which is better to use- MapReduce or Aggregation pipeline?

有些博客说mapreduce比聚合慢。那么哪一个最适合使用呢?

如果你浏览official document 你可以清楚地看到它写着:

对于大多数聚合操作,聚合管道提供更好的性能和更连贯的界面。但是,map-reduce 操作提供了聚合管道目前不具备的一些灵活性。