超时等待MongoConnection [英] Timeout waiting for a MongoConnection

查看:168
本文介绍了超时等待MongoConnection的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么从蒙戈C#驱动程序,而从MongoDB的服务器获取对象,则会出现以下异常?

Why does the following exception occurs from the Mongo C# driver while getting object from the MongoDB server?

超时等待MongoConnection 。

"Timeout waiting for a MongoConnection."

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

Is there a way to set this connection timeout somewhere or fix this issue?

推荐答案

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

You can use socketTimeoutMS in your connection string to increase the timeout.

例如:

mongodb://localhost/myCollection?socketTimeoutMS=60000

这篇关于超时等待MongoConnection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆