我在mlab创建了一个MongoDB帐户,但似乎无法连接到它。凭据凭据失败。我似乎无法弄明白,我做错了什么,除了它可能是连接字符串。问题是,我从Mlab那里得到了(在这里添加了它,但没有正确的用户和密码)
提前致谢
Dim connstring As String = "mongodb://USER:PASS@ds021239.mlab.com:22234"
Dim mongo As MongoServer = MongoServer.Create(connstring)
mongo.Connect()
Dim mydatabase As MongoDatabase = mongo.GetDatabase("profundo", SafeMode.True)
Dim collection = mydatabase.GetCollection(Of BsonDocument)("Client")
MsgBox(collection.Count)