0
我無法獲得VB.net連接到MongoDB的replicaset - 它會拋出異常MongoDB的查詢在VB.Net
dim mongo as MongoDBClient
dim mgDB as MongoDatabase
dim mgcol as MongoCollection(of Bob)
public class Bob
public property ID as ObjectID
public property Name as string
end class
sub Main()
try
mongo = New MongoClient("mongodb://ip:port,ip:port,ip:port/?replicaSet=Bob")
mgDB = mongo.GetDatabase("test")
mscol = mgDB.Collection(of Bob)("test.me")
mgDB.GetCollection("test.me").Find(MongoDB.Driver.Builders.Query.Exists("id"))
catch ex as Exception
console.writeline(ex)
end try
end sub
我不知道我應該如何通過VB .NET來查詢?