MongoDB报错,Sort operation used more than the maximum 33554432 bytes of RAM.Add an index
之前使用mongodb时由于数据过多导致报错
Sort operation used more than the maximum 33554432 bytes of RAM.Add an index
查的数据有1700多条就出现这个问题了。
这是内存不够的原因
**网上有两种解决办法:
1. 增加RAM
在robot的命令栏输入:
db.adminCommand({setParameter:1,internalQueryExecMaxBlockingSortBytes:335544320})
然后按ctrl+enter
2.还有一个是建索引**
db.article.ensureIndex({"create_time":1})
这个创建索引的字段需要是你进行条件查询时的字段,如下
在进行查询时,用sort进行条件查询
db.getCollection('hhh').find({"create_time":{"$lt":"2021-04-28"}}).sort("create_time": -1)
json中1代表正序,-1代表反序
MongoDB报错,Sort operation used more than the maximum 33554432 bytes of RAM.Add an index相关推荐
- mongodb报错一例
开发程序报错信息: Caused by: com.mongodb.MongoException: Executor error: OperationFailed: Sort operation use ...
- mongodb报错:Problem inserting to mongo collection: no reachable servers
文章目录 mongodb报错:Problem inserting to mongo collection: no reachable servers mongodb报错:Problem inserti ...
- RedisTemplate报错WRONGTYPE Operation against a key holding the wrong kind of value
场景 今天写业务代码,先从redis中读取值,不存在的话加redis锁,锁定之后再次尝试读取一次redis,没有值的话去db中读取并写redis缓存. 非常简单的代码,确报错WRONGTYPE Ope ...
- SVN报错“previous operation has not finished…“的解决办法
SVN因多次操作卡死,报错"previous operation has not finished-", 无法进行任何新操作时,可以在SVN的工作目录下打开命令行窗口,输入&quo ...
- 解决MongoDB报错:Cannot create collection “None“ as a capped collection as it already exist
解决MongoDB报错:Cannot create collection "None" as a capped collection as it already exist Roo ...
- WSL2使用Python访问Windows 10上的MongoDB报错:pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Er
WSL2使用Python访问Windows 10上的MongoDB报错:pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Er ...
- 报错解决:ad NaCl helper startup ack (0 bytes)
此文首发于我的个人博客:报错解决:ad NaCl helper startup ack (0 bytes) - zhang0peter的个人博客 在使用pyppeteer操作Chrome进行爬虫时,大 ...
- 启动报错java.net.ConnectException: [NACOS HTTP-POST] The maximum number of tolerable
启动报错java.net.ConnectException: [NACOS HTTP-POST] The maximum number of tolerab 原因 项目的配置文件有applicatio ...
- 编译make px4_fmu-v2_default upload时,报错ERROR Board can accept larger flash images (2080768 bytes)
编译make px4_fmu-v2_default upload时,报错ERROR: Board can accept larger flash images (2080768 bytes) than ...
- Qt报错:cc1plus.exe: out of memory allocating 65536 bytes
Qt报错:cc1plus.exe: out of memory allocating 65536 bytes 今天编译Qt程序,出现这个问题: cc1plus.exe: out of memory a ...
最新文章
- 针对表单的事件;条件语句;定时器的简单介绍;
- 《深度学习的数学》笔记【各种概念】
- 复制当前光标所在单词句子
- 关于invSqrt( )函数
- 《移山之道》第十一章:两人合作 读书笔记 PB16110698 第六周(~4.15)
- 使用log4j日志-配置载入问题
- poj 1426 BFS
- 手写一个promise用法_手写一个自己的 JavaScript Promise 类库
- 简谈Java的join()方法(转)
- 苹果手机速度慢_安卓手机用户也想体验一下MagSafe充电器?还是算了吧!
- ArcGIS与地理加权回归GWR【一】
- 入门系列- ABP 本地化
- Android/Linux USB HID驱动(即USB鼠标USB键盘等驱动)相关文件
- 空间直角坐标转大地坐标
- 辅助驾驶功能开发-功能规范篇(05)-智能限速辅助SLA
- QT下获取汉字拼音首字母
- 双矩阵对策MATLAB,带有模糊收益的双矩阵对策研究
- Java类型转换(自动类型转换+强制类型转换)
- JAVA 人工神经网络实现,机器学习,人工智能
- 福师《大学摄影》在线作业一、二