[DOCS-12057] Document how to use MongoClientSettings in greater details for the C# Driver Created: 14/Sep/18  Updated: 27/Oct/23  Resolved: 01/Jun/23

Status: Closed
Project: Documentation
Component/s: drivers
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Davenson Lombard Assignee: Unassigned
Resolution: Gone away Votes: 0
Labels: _ref-hold
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 35 weeks, 6 days ago

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



 Comments   
Comment by Rea Rustagi [ 01/Jun/23 ]

This ticket refers to the legacy C#docs. The new C# documentation covers these topics.

Comment by Susan Kerschbaumer (Inactive) [ 14/Sep/18 ]

rathi.gnanasekaran we don't reference this in our docs yet, so perhaps a change in the C# docs is in order?

Generated at Thu Feb 08 08:04:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.