M
M
MongoProblem2017-03-22 07:01:48
MongoDB
MongoProblem, 2017-03-22 07:01:48

MongoDB Topology was destroyed. How to set up a connection?

I have a small project (API) using MongoDB + NodeJS (Mongoose). It seems that with a large number of requests from users, a MongoDB connection error occurs and a Topology was destroyed error occurs. I looked through the answers to the question in the English-speaking sector - I did not understand anything particularly sensible. It seems that I just misconfigured my connection to Mongo. Maybe someone knows how best to set up a connection to production? Or tell me where to dig? The current settings for Mongo are:

{ 
  server: {
    auto_reconnect: true,
    poolSize:100,
    socketOptions: {
      keepAlive: 10000,
      connectTimoutMS: 10000
    }
  } 
}

I am working with Mongo for the first time, so I will be glad for any help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question