Подтвердить что ты не робот

Как решить MongoError: пул разрушен при подключении к CosmosDB

У меня есть служба Node.js, в которой я использую mongo-API для связи с Document/Cosmos DB. Моя служба работает нормально и выполняет всю операцию crud, но через 1 минуту из-за ошибки выдается ошибка mongo.

/document-db-service/node_modules/mongodb/lib/utils.js:123
    process.nextTick(function() { throw err; });
                                  ^
MongoError: pool destroyed
    at Pool.write (/document-db-service/node_modules/mongodb-core/lib/connection/pool.js:922:12)
    at Cursor._find (/document-db-service/node_modules/mongodb-core/lib/cursor.js:286:22)
    at nextFunction (/document-db-service/node_modules/mongodb-core/lib/cursor.js:584:10)
    at Cursor.next [as _next] (/document-db-service/node_modules/mongodb-core/lib/cursor.js:692:3)
    at fetchDocs (/document-db-service/node_modules/mongodb/lib/cursor.js:856:10)
    at toArray (/document-db-service/node_modules/mongodb/lib/cursor.js:883:3)
    at Cursor.toArray (/document-db-service/node_modules/mongodb/lib/cursor.js:836:44)
    at exports.getDocsOfCollections (/document-db-service/services/collections.js:273:10)
    at Layer.handle [as handle_request] (/document-db-service/node_modules/express/lib/router/layer.js:95:5)
    at next (/document-db-service/node_modules/express/lib/router/route.js:137:13)

Я не могу понять, почему эта ошибка подходит. Пожалуйста, предложите изменения, которые необходимо выполнить для устранения этой ошибки.

4b9b3361

Ответ 1

Я столкнулся с той же проблемой, удалив параметр набора реплик в строке подключения mongodb:       ........./?ssl=true**&replicaSet=globaldb** то он отлично работал