【发布时间】:2020-10-20 16:28:42
【问题描述】:
我要查询一个mongodb数据库
我正在这样做:
var filter = Builders<BsonDocument>.Filter.Eq("origine", sOrigin)
& BsonDocument.Parse("{$expr: {$ne:['$crc_n', '$crc_n_1']} }");
var sort = Builders<BsonDocument>.Sort.Ascending("update_date");
List<BsonDocument> docs = collection.Find(filter).Sort(sort)
.Limit(5000)
.ToList();
但我有这个消息:
Command find failed: Executor error during find command :: caused by :: Sort
exceeded memory limit of 104857600 bytes, but did not opt in to external sorting.
Aborting operation. Pass allowDiskUse:true to opt in.."}
我不想更改限制或自定义服务器。我想通过代码来管理。
我必须使用限制较小的线程吗?
我必须使用 ConcurrentBag 并查询我的数据库吗?
不接触服务器我能做什么?
【问题讨论】: