且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MongoDB,使用聚合分组框架来获取唯一的字符串

更新时间:2023-11-15 18:40:58

您正在正确进行聚合,但是如错误消息所示,完整的

You're doing the aggregation correctly, but as the error message indicates, the full result of the aggregate call cannot be larger than 16 MB.

解决方法是添加一个过滤器以减小结果的大小,或者改用map-reduce并将结果输出到另一个集合.

Work-arounds would be to either add a filter to reduce the size of the result or use map-reduce instead and output the result to another collection.