LoginSignup
1
0

More than 5 years have passed since last update.

MongoError: BSONObj size is invalid error

Last updated at Posted at 2015-07-02

問題

Mongodbを使っていると、なんらかの理由で、以下のようなエラーが起きることがあります。

MongoError: exception: BSONObj size: -286331154 (0xEEEEEEEE) is invalid. Size must be between 0 and 16793600(16MB) First element: _id: ObjectId('hoge’)

解決策

私の場合はMacOSが不正にシャットダウンしてしまった後に起きましたが、以下の方法で修復できました。

  1. dbフォルダをバックアップ
  2. 以下のコマンドでデータを修復

$mongod —repair —dbpath ~/.db

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0