MongoClient 和 MongoConnection 有什么区别

what is the difference between MongoClient and MongoConnection

我想知道mongoClientmongoConnection有什么区别,这两个代码有什么区别

  serverAddress=new ServerAddress("Localhost",27017)
           client= MongoClient(serverAddress)
           testDB = client("testdb")//get database Name
           collection = testDB("mycol")//get collection Name 

 serverAddress=new ServerAddress("Localhost",27017)
           con= MongoClient(serverAddress)
           testDB = con("testdb")//get database Name
           myCollection = testDB("mycol")//get collection Name 

请解释有什么区别

MongoConnection 已被弃用,取而代之的是 MongoClient。据我所知,在引入 MongoClient 时没有区别。我想功能可能会随着时间的推移而发生变化。

来自 API 教程:Casbah API tutorial

"MongoClient was added to the Java driver in 2.10 as the default connection class for MongoDB. Older Casbah code may use MongoConnection which should be updated to use MongoClient."