之前使用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相关推荐

  1. mongodb报错一例

    开发程序报错信息: Caused by: com.mongodb.MongoException: Executor error: OperationFailed: Sort operation use ...

  2. mongodb报错:Problem inserting to mongo collection: no reachable servers

    文章目录 mongodb报错:Problem inserting to mongo collection: no reachable servers mongodb报错:Problem inserti ...

  3. RedisTemplate报错WRONGTYPE Operation against a key holding the wrong kind of value

    场景 今天写业务代码,先从redis中读取值,不存在的话加redis锁,锁定之后再次尝试读取一次redis,没有值的话去db中读取并写redis缓存. 非常简单的代码,确报错WRONGTYPE Ope ...

  4. SVN报错“previous operation has not finished…“的解决办法

    SVN因多次操作卡死,报错"previous operation has not finished-", 无法进行任何新操作时,可以在SVN的工作目录下打开命令行窗口,输入&quo ...

  5. 解决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 ...

  6. WSL2使用Python访问Windows 10上的MongoDB报错:pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Er

    WSL2使用Python访问Windows 10上的MongoDB报错:pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Er ...

  7. 报错解决:ad NaCl helper startup ack (0 bytes)

    此文首发于我的个人博客:报错解决:ad NaCl helper startup ack (0 bytes) - zhang0peter的个人博客 在使用pyppeteer操作Chrome进行爬虫时,大 ...

  8. 启动报错java.net.ConnectException: [NACOS HTTP-POST] The maximum number of tolerable

    启动报错java.net.ConnectException: [NACOS HTTP-POST] The maximum number of tolerab 原因 项目的配置文件有applicatio ...

  9. 编译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 ...

  10. 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 ...

最新文章

  1. 针对表单的事件;条件语句;定时器的简单介绍;
  2. 《深度学习的数学》笔记【各种概念】
  3. 复制当前光标所在单词句子
  4. 关于invSqrt( )函数
  5. 《移山之道》第十一章:两人合作 读书笔记 PB16110698 第六周(~4.15)
  6. 使用log4j日志-配置载入问题
  7. poj 1426 BFS
  8. 手写一个promise用法_手写一个自己的 JavaScript Promise 类库
  9. 简谈Java的join()方法(转)
  10. 苹果手机速度慢_安卓手机用户也想体验一下MagSafe充电器?还是算了吧!
  11. ArcGIS与地理加权回归GWR【一】
  12. 入门系列- ABP 本地化
  13. Android/Linux USB HID驱动(即USB鼠标USB键盘等驱动)相关文件
  14. 空间直角坐标转大地坐标
  15. 辅助驾驶功能开发-功能规范篇(05)-智能限速辅助SLA
  16. QT下获取汉字拼音首字母
  17. 双矩阵对策MATLAB,带有模糊收益的双矩阵对策研究
  18. Java类型转换(自动类型转换+强制类型转换)
  19. JAVA 人工神经网络实现,机器学习,人工智能
  20. 福师《大学摄影》在线作业一、二

热门文章

  1. 不规则四面体知道六边的体积公式
  2. 计算机辅助翻译政府工作报告,Trados辅助翻译软件在科技英语翻译中的应用
  3. 开源OA协同办公系统:O2OA搭建企业微信办公首页说明
  4. 有哪些文艺而有韵味的句子?
  5. 2021-06-05按键精灵实现远程获取消息内容
  6. 苹果个人开发者账号审核
  7. 重学statistics,Cha3 Descriptive Statistics: numerical measures
  8. Redis数据结构之字符串对象
  9. termux搭建局域网web服务器
  10. 计算机编程入门先学什么最好?