@@ -14,6 +14,40 @@ Quick Start
1414
1515.. include:: /includes/quick-start/overview.rst
1616
17+ Create a MongoDB Cluster
18+ ------------------------
19+
20+ Set Up a Free Tier Cluster in Atlas
21+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22+
23+ To set up your Atlas Free Tier Cluster required for this guide, complete the guide on
24+ :guides:`MongoDB Atlas Setup </atlas/account>`.
25+
26+ After completing the steps in the Atlas guide, you have a new MongoDB
27+ cluster deployed in Atlas, a new database user, and
28+ :atlas:`sample datasets loaded </sample-data/>` into your cluster. You also have
29+ a connection string similar to the following in your copy buffer:
30+
31+ .. code-block:: bash
32+
33+ "mongodb+srv://<username>:<password>@cluster0.abc.mongodb.net/?retryWrites=true&w=majority"
34+
35+ Set Your Connection String
36+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
37+
38+ Run the following code at the command prompt to save your MongoDB connection string to an
39+ environment variable. This method is safer than including your credentials in your source
40+ code.
41+
42+ .. code-block:: bash
43+
44+ export MONGODB_URI='<your MongoDB connection string>'
45+
46+ .. important::
47+
48+ Make sure to replace the ``<username>`` and ``<password>`` sections of the connection
49+ string with the username and password of your Atlas user.
50+
1751Set Up Your Project
1852-------------------
1953
@@ -39,32 +73,21 @@ Use the ``dotnet add`` command to add the {+driver-short+} to your project as a
3973
4074 dotnet add package MongoDB.Driver
4175
42- Create a MongoDB Cluster
43- ------------------------
44-
45- .. include:: /includes/quick-start/atlas-setup.rst
46-
4776Query Your MongoDB Cluster from Your Application
4877------------------------------------------------
4978
50- First, save your Atlas connection string to an environment variable named ``MONGODB_URI``. This prevents potential security issues caused by including your credentials in the source code.
79+ In this step, you'll use the {+driver-short+}
80+ to connect to your MongoDB cluster and run a query on the sample data.
5181
52- .. code-block:: bash
53-
54- export MONGODB_URI='<your atlas connection string>'
55-
56- .. important::
57-
58- Make sure to replace the "<username>" and "<password>" sections of the connection string with the username and password of your Atlas user.
59-
60- Next, open the file named ``Program.cs`` in the base directory of your project. Copy the
82+ Open the file named ``Program.cs`` in the base directory of your project. Copy the
6183following sample code into ``Program.cs``
6284
6385.. literalinclude:: /includes/quick-start/Program.cs
6486 :language: csharp
6587 :dedent:
6688
67- The sample code runs a query against your sample dataset in MongoDB Atlas. Run the sample code with the following command from your command line:
89+ This sample code runs a query against your sample dataset in MongoDB Atlas. Run it
90+ from your command line by using the following command:
6891
6992.. code-block:: bash
7093
@@ -81,7 +104,12 @@ After completing this step, you should have a working application that uses
81104the {+driver-short+} to connect to your MongoDB cluster, run a query on the
82105sample data, and print out the result.
83106
107+ To learn more about connecting to Atlas with the {+driver-short+}, see
108+ the :atlas:`Atlas driver connection </driver-connection>` guide
109+ and select :guilabel:`{+language+}` from the :guilabel:`Select your language` dropdown.
110+
84111Next steps
85112----------
86113
87- .. include:: /includes/quick-start/next-steps.rst
114+ Learn how to read and modify data using the {+driver-short+} in the CRUD Operations
115+ guide or how to perform common operations in Usage Examples.
0 commit comments