Need Help: Un-deleteable and Un-updateable Big Document Causing Collection Lag and Server Freezing

Hello MongoDB Community,

I’m facing a perplexing issue with one of my collections and I’m seeking your expertise to shed some light on the problem. Recently, I encountered a big document in my MongoDB collection that seems to be un-deleteable and un-updateable. Whenever I attempt to delete or update this document, it takes an extraordinarily long time with no discernible result, and to make matters worse, my server starts freezing during the process.

Here are some additional details:

  1. The document in question is considerably large, with a size equals to 3605802 (calculated using the bsonsize command: bsonsize(db.col.findOne({"_id": ObjectId("645ce70b91f8446dbcbb74e4")}))).
  2. The document in question is considerably large, and it appears to be causing a strain on my collection’s performance.
  3. I have attempted various methods to remove fields from the document, including delete and update operations, but none of them seem to have any effect. The operation simply hangs indefinitely.
  4. As a consequence of this issue, my server experiences significant freezing, which disrupts other operations and negatively impacts the overall system performance.

Has anyone encountered a similar problem with un-deleteable and un-updateable large documents causing collection lag and server freezing, especially those exceeding 3605802 in size? I would greatly appreciate any insights, suggestions, or guidance you can provide to help resolve this issue.

Additionally, if there are any specific troubleshooting steps or best practices to address such situations, I would be grateful to know about them.

Thank you in advance for your assistance!

Best regards,
Mohammed Alhanafi

Mogodb supports 16MB document, so 3.x M is really not that big (i suppose).

When your delete operation hangs, what does your server say in the log file?

Thank you for replying, when I do deleting, it didn’t delete or finish the operation at all, so after more than 10 hours and still server is performing this query with no results and server is lagging until restarted.

For you to know, the command is executed from same database server by background process to take all the time needed, but after all the time given nothing still happens.

mongo --eval 'db.col.deleteOne({"_id": ObjectId("645ce70b91f8446dbcbb74e4")});' myDocs

Thanks in advanced.