c# - 等待 MongoConnection 超时

标签 c# mongodb

为什么Mongo C#驱动从MongoDB服务器获取对象时会出现如下异常?

"Timeout waiting for a MongoConnection."

有没有办法在某处设置此连接超时或解决此问题?

最佳答案

您可以在连接字符串中使用 socketTimeoutMS 来增加超时。

例子:

mongodb://localhost/myCollection?socketTimeoutMS=60000

关于c# - 等待 MongoConnection 超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9594273/

相关文章:

mongodb - Composer 不安装 mongodb ubuntu

mongodb mongodump mongorestore

c# - 如何仅包含相关实体的选定属性

arrays - 更新 MongoDB 中集合数组内的集合

mongodb - Golang MongoDB 不返回条件查询

c# - MVC Controller 访问

python - 根据 MongoDB 中的字典键过滤文档

c# - Visual Studio 2012 不允许我调试接口(interface)的实现

c# - 为 C# 中的类扩展简单的 getter、setter 方法

c# - 如何在 asp.net mvc core 中为 Identity Server 4 编写集成测试