当我在monogdb中保存文档时,收到以下错误:
WriteConcern detected an error 'insertDocument :: caused by ::
0 assertion srcmongodbstructurebtreebtree.cpp:390'.
(Response was {
"ok" : 1, "code" : 8, "err" : "insertDocument :: caused by :: 0
assertion src\mongo\db\structure\btree\btree.cpp:390", "n" : NumberLong(0)
})
请帮忙吗?
在将
密钥添加到存储桶verify()
断言调用期间,代码似乎失败了。此错误应附带日志文件中的其他详细信息,例如:
btree 存储桶损坏? 考虑重新索引或运行验证命令 klast: X 键: Y
哪些迹象表明您的 btree 存储桶可能已损坏。
因此,请考虑通过以下方式修复数据库:
mongod --repair --dbpath /path/to/data/db
然后在必要时重新编制索引。
此外,请确保您的设备上有足够的可用空间,并获得正确的读写权限。如果这种情况经常发生,则可能是存储设备的错误或故障。