Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-12057

Document how to use MongoClientSettings in greater details for the C# Driver

    • Type: Icon: Improvement Improvement
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: drivers
    • Labels:

      Description

      Hi all,

      The C# documentation provide a very basic example on MongoClientSettings. Only the ReplicaSetName parameter is shown but no details about authentication, ssl, and listing the hosts in the linked page.

      It would be good to have an example that can be used with MongoDB Atlas like this:

      List<MongoServerAddress> _servers = new List<MongoServerAddress>();
      
                  _servers.Add(new MongoServerAddress(<hostname 1>,27017));
                  _servers.Add(new MongoServerAddress(<hostname 2>, 27017));
                  _servers.Add(new MongoServerAddress(<hostname 3>, 27017));
      
                  var settings = new MongoClientSettings
                  {
      
      
                      Credential = MongoCredential.CreateCredential("admin", <username>, <password>),
                      ReplicaSetName = <replicasetName>,
                      Servers = _servers,
                      UseSsl = true,
                      VerifySslCertificate = false,
      
                  };
                  var client = new MongoClient(settings);
      

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

            Assignee:
            Unassigned Unassigned
            Reporter:
            davenson.lombard@mongodb.com Davenson Lombard
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              46 weeks ago