Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BSONObj size error in mongodb

Tags:

mongodb

Assertion: 10334:BSONObj size: 27624158 (0xDE82A501) is invalid. Size must be between 0 and 16793600(16MB) First element: _id: ObjectId('5329dd954a33b081be667532') . I am getting the above error when I run my .js file. I have two collections city and country which have more than 15 million record and I am doing indexing on some filed on those two collections. What may be the problem ?

like image 890
prashantas Avatar asked Mar 21 '14 04:03

prashantas


2 Answers

Sounds like you either have a corrupt index or document.

I would try one of two things in the following order:

  1. Repair the database http://docs.mongodb.org/manual/reference/command/repairDatabase/

  2. if you are able to remove the corresponding document with the id: ObjectId('5329dd954a33b081be667532').

like image 54
SCB Avatar answered Oct 13 '22 18:10

SCB


Stumbled upon similar issue. The field which I passed for _id in $group operation stage was absent in some documents hence, aggregation pipeline was throwing error of BSONObj size: 18441867 (0x119668B) is invalid.

Issue was resolved for me when after adding {field_for_group:{$exists:true}} in $match stage of the aggregate pipeline.

like image 2
dc7 Avatar answered Oct 13 '22 16:10

dc7