炫意html5
最早CSS3和HTML5移动技术网站之一

Driver工具类和mongodb交互的时候报错

Driver工具类和mongodb交互的时候报错

连接代码
var mongodbClient = “mongodb://MyMongoDB:123456@localhost:27017/MyDataBase?readPreference=primaryPreferred&replicaSet=Mylocalhost&authSource=MyDataBase”;

报错信息
A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : “1”, ConnectionMode : “ReplicaSet”, Type : “ReplicaSet”, State : “Disconnected”, Servers : [] }.

回答

你把问号后面的内容去掉试试,问号前面就够了
var mongodbClient = “mongodb://MyMongoDB:123456@localhost:27017/MyDataBase”;

炫意HTML5 » Driver工具类和mongodb交互的时候报错

Java基础教程Android基础教程