假设一个集合的模式如下所示:{"customer":,"purchase":,}现在,我想获得前5位客户(按购买数量),第6个桶是“其他”,它结合了其他客户的所有购买数量。基本上,聚合的输出应该是这样的:{"_id":"customer100","purchasequantity":4000000}{"_id":"customer5","purchasequantity":81800}{"_id":"customer4","purchasequantity":40900}{"_id":"customer3","purchasequantity":440}{"_id":"customer
假设一个集合的模式如下所示:{"customer":,"purchase":,}现在,我想获得前5位客户(按购买数量),第6个桶是“其他”,它结合了其他客户的所有购买数量。基本上,聚合的输出应该是这样的:{"_id":"customer100","purchasequantity":4000000}{"_id":"customer5","purchasequantity":81800}{"_id":"customer4","purchasequantity":40900}{"_id":"customer3","purchasequantity":440}{"_id":"customer