MongoDB - 配额超出错误代码 : 12501

标签 mongodb

我正在使用 MongoDB 的 Sandbox(版本:3.2.12)数据库,并且部署在 mLab 上。添加/插入记录时我遇到了一个奇怪的问题(来自 shell 和应用程序)。

我没有为数据库文件设置任何配额限制。

错误信息:

“错误信息:配额超出错误代码:12501”

但我在数据库中有足够的内存,我可以在“xyz”集合之外的其他集合中添加/插入记录。

但是,我已经从“xyz”集合中删除了一些记录以释放内存并再次尝试插入记录。例如。删除了集合中的 2 条记录,之后仅插入了 2 条记录。

我能否将更多文件添加到我的配额中,如果可以,如何添加?

有什么办法可以调试吗?或者任何其他不删除数据库的解决方案?

最佳答案

请尝试修复您的数据库。

Sometimes it’s necessary to compact your database in order to reclaim disk space (e.g., are you quickly approaching your storage limits?) and/or reduce fragmentation. When you compact your database, you are effectively reducing its file size.

Compacting Sandbox and single-node plan deployments

If you are on a Sandbox or single-node plan and would like to try to reclaim disk space, you can use MongoDB’s repairDatabase command.

If your fileSize or “Size on Disk” is under 1.5 GB, you can run this repair command directly through our UI by visiting the page for your database, clicking on the “Tools” tab next, and then selecting “repairDatabase” from the drop-down list. Otherwise, you can run the db.repairDatabase() command after connecting to your database with the mongo shell.

https://docs.mlab.com/ops/#compacting

repairDatabase 命令是一个阻塞操作。在修复完成之前,您的数据库将不可用。

这可能需要大约 20-30 秒。

关于MongoDB - 配额超出错误代码 : 12501,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42619558/

相关文章:

java - 如何在mongo查询java驱动程序中执行$or和 "and"?

使用 MongoDB 驱动程序时出现 java.lang.NoClassDefFoundError

mongodb - 如何在 mongodb 中提取数组元素(即文档)?

java - Spring Data MongoDB - 使用嵌套字段投影进行聚合

mongodb - 是否有支持地理空间查询的图形文档数据库?

javascript - 如何使用express/mongoose和客户端JS将HTML类发布到mongoDB集合中?

node.js - 如何使用 $filter 获取数组字段的过滤元素

node.js - MongoDB 用户及其组的聚合

MongoDB分片,添加新节点时如何重新平衡?

MongoDB:具有稀疏值的唯一和稀疏复合索引