I am working with a MongoDB Atlas database that has a collection with ~7 million documents in it. I run an operation to delete ~3 million of those documents. It runs OK for 25 minutes (deleting most of the documents) but then gives me the following error: “MongoNetworkError: connection 3 to [myAtlasURL]:27017 timed out”. The operation proceeds without issue on smaller deletes.
I understand it’s a timeout error. Is the best way to fix this to increase RAM or to increase the timeout setting for MongoDB and, if so, to what? I think the default may be 30 seconds. Presumably the deletes are batched and after a while their is no response in 30 seconds.