Unable to export MongoDB collection due to one corrupt document

95 views
Skip to first unread message

Kowshik Nandagudi

unread,
Sep 8, 2017, 12:35:40 PM9/8/17
to mongodb-user
Hi All,

I have a MongoDB database  with a collection having 40 million documents 

One document seems to be corrupt and unable to export the collection using mongoexport or mongodump.

IT stops at 10( sometimes 12 or 15% ) and stops.

How do we force export or dump to ignore these documents and continue further.

Many Thanks for your help in advance

Kowshik


Kevin Adistambha

unread,
Sep 26, 2017, 9:57:02 PM9/26/17
to mongodb-user

Hi Kowshik

It’s been some time since you posted this. Have you find a workaround?

One document seems to be corrupt and unable to export the collection using mongoexport or mongodump.

If you’re running the MMAPv1 storage engine, you may be able to run mongodump --repair (see the mongodump repair section). However, this option is not available if you’re using the WiredTiger storage engine. in which case, you would need to repair the data first using mongod --repair as stated in the linked page.

Before doing this operation, it’s important to fully understand the consequences of using it. Namely, please don’t run this command on a replica set member, and only use it as a last resort. Please see the repairDatabase page for more information.

If you're still having an issue, it will be helpful if you could post your MongoDB version as well.

Best regards,
Kevin

Reply all
Reply to author
Forward
0 new messages