prashantas
prashantas

Reputation: 455

BSONObj size error in 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 ?

Upvotes: 12

Views: 17603

Answers (2)

dc7
dc7

Reputation: 418

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.

Upvotes: 3

SCB
SCB

Reputation: 3084

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').

Upvotes: 3

Related Questions