I’m currently learning and the way I connect to the database is by using one client for each collection.
now I have 7 collections which is 7 MongoClients, should I change my code to use one client only ?
Reuse Your Client
Because each
MongoClient
represents a pool of connections to the database, most applications require only a single instance ofMongoClient
, even across multiple requests
From https://www.mongodb.com/docs/drivers/csharp/current/fundamentals/connection/connect/