Mongoid查询内存限制

时间:2015-06-04 11:39:43

标签: ruby mongodb mongoid

我的数据库中有大约100万条记录。 当我这样做时:

MyModel.distinct(:my_field) 

收到此错误 -

failed with error 17217: "exception: distinct too big, 16mb cap"

试图通过聚合来实现 - 获得相同的错误。

group = {"$group" => {"_id" => {"my_field" => "$my_field"}}}
MyModel.collection.aggregate(group)

failed with error 16389: "exception: aggregation result exceeds maximum document size (16MB)"

Mongoid有没有办法将内存限制从16mb增加到100mb?或者是获得这些截然不同结果的其他任何方式? 或者如何使用Mongoid管理大型查询?

0 个答案:

没有答案