如何解决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) 

我无法理解为什么会出现这个错误。请提出解决此错误所需的更改。

我遇到了同样的问题,删除连接stringmongodb中的副本集参数: ........./?ssl=true**&replicaSet=globaldb**然后它工作正常