聚合报错 $group,but didn't allow external Sort.Pass allowDiskuse:true

db.getCollection('xxx').aggregate([{$group:{_id:{"id":"$xx","name":"$yy"},count:{$sum:1}}},{$match:{count:{$gt:1}}}],{ allowDiskUse: true })

原因是聚合的结果必须要限制在16M以内操作,(mongodb支持的最大影响信息的大小),否则必须放在磁盘中做缓存(allowDiskUse=True)。


 

猜你喜欢

转载自blog.csdn.net/zhuchunyan_aijia/article/details/83040312
今日推荐