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

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Gone away
    • Icon: Major - P3 Major - P3
    • None
    • None
    • drivers

    Description

      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.)

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              35 weeks, 6 days ago