I'm quite confused as to whether DB is deprecated in favor of MongoDatabase. I see that Mongo.getDB is deprecated, but DB itself is not. It's quite confusing and duplicative to have both DB and a MongoDatabase. I think the answer is that one of them is deprecated. However, it hasn't been deprecated in the code and in fact my entire code base compiles fine without a single deprecation warning.