I'm just looking for a way to initialize a MongoClient
using MongoClientSettings
with a provided connection string.
Can not find any example of this on the project website. These are all their examples:
// To directly connect to a single MongoDB server
// (this will not auto-discover the primary even if it's a member of a replica set)
var client = new MongoClient();
// or use a connection string
var client = new MongoClient("mongodb://localhost:27017");
// or, to connect to a replica set, with auto-discovery of the primary, supply a seed list of members
var client = new MongoClient("mongodb://localhost:27017,localhost:27018,localhost:27019");
This way you can do this :
And create the
MongoClient
using this command: