Skip to content

DOCSP-49868 - MongoUrl #629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 32 commits into
base: docsp-45382-comp-cvg
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 31 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,727 changes: 1,313 additions & 414 deletions source/connect/connection-options.txt

Large diffs are not rendered by default.

17 changes: 6 additions & 11 deletions source/connect/mongoclient.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,15 @@ connection URI to connect to a MongoDB deployment running on port ``27017`` of `
const string uri = "mongodb://localhost:27017/";
var client = new MongoClient(uri);

Configure the MongoClient
-------------------------
Configure the Connection
------------------------

You can configure settings for the ``MongoClient`` object by passing a
``MongoClientSettings`` object to the constructor. The following example creates a
``MongoClient`` object and sets the ``UseTls`` property to ``true``:
You can configure your connection in the following ways:

.. code-block:: csharp

var connectionString = "mongodb://localhost:27017/"
var settings = MongoClientSettings.FromConnectionString(connectionString);
settings.UseTls = true;
- Specifying parameters in the connection URI
- Specifying settings on a ``MongoClientSettings`` or ``MongoUrlBuilder`` object

To view a full list of the settings you can configure, see the
To learn more about configuring your connection, see the
:ref:`csharp-connection-options` guide.

API Documentation
Expand Down
Loading
Loading