In the official documentation documentation about MongoClient write:

Base class for implementors of IMongoClient.

And about MongoServer :

Represents a MongoDB server (either a single instance or a replica set) and the settings used to access it. This class is thread-safe.

On the one hand, both classes make it possible to get IMongoDatabase and continue working with the database. But on the other hand, why are these two classes necessary then?

In which cases to use MongoServer , and in which MongoClient - it is not clear. Actually, I ask you to help me in this.

    1 answer 1

    MongoServer is a class from the MongoDB.Driver.Legacy assembly - the old driver version. Use MongoClient .