Skip to content

Commit 35701ec

Browse files
authored
JS review session (#61)
- Reviewed by @jordan-smith721
1 parent 751e4d3 commit 35701ec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+245
-1184
lines changed

snooty.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ mongo-enterprise = "MongoDB Enterprise Edition"
2727
docs-branch = "master" # always set this to the docs branch (i.e. master, 1.7, 1.8, etc.)
2828
version-number = "2.18" # always set this to the driver branch (i.e. 1.7.0, 1.8.0, etc.)
2929
version = "v{+version-number+}"
30-
example = "https://raw.githubusercontent.com/mongodb/docs-csharp/{+docs-branch+}/source/includes/usage-examples/code-examples"
30+
example = "https://raw.githubusercontent.com/mongodb/docs-csharp/{+docs-branch+}/source/includes/code-examples"
3131
stable-api = "Stable API"
3232
api-root = "https://mongodb.github.io/mongo-csharp-driver/{+version-number+}/apidocs/html"
3333
bool-data-type = "``boolean``"

source/compatibility.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ MongoDB Compatibility
1717
The following compatibility table specifies the recommended version(s) of the
1818
{+driver-long+} for use with a specific version of MongoDB.
1919

20-
The first column lists the driver version(s).
20+
The first column lists the driver version.
2121

2222
.. sharedinclude:: dbx/compatibility-table-legend.rst
2323

@@ -26,10 +26,10 @@ The first column lists the driver version(s).
2626
Language Compatibility
2727
----------------------
2828

29-
The following compatibility table specifies the recommended version(s) of the
29+
The following compatibility table specifies the recommended version of the
3030
{+driver-long+} for use with a specific version of C#.
3131

32-
The first column lists the driver version(s).
32+
The first column lists the driver version.
3333

3434
.. include:: /includes/language-compatibility-table-csharp.rst
3535

source/fundamentals/connection/tls.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ through a parameter in your connection string.
3939

4040
.. code-block:: csharp
4141

42-
var settings = new MongoClientSettings() { UseTls = true };
42+
var settings = new MongoClientSettings { UseTls = true };
4343
var client = new MongoClient(settings);
4444

4545
.. tab:: Connection String

source/fundamentals/crud/read-operations/retrieve.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,20 @@ The examples in this guide use the ``sample_restaurants.restaurants`` collection
2525
from the :atlas:`Atlas sample datasets </sample-data>`. To learn how to create a
2626
free MongoDB Atlas cluster and load the sample datasets, see the :ref:`<csharp-quickstart>`.
2727

28-
The following ``Restaurants`` class models the documents in this collection:
28+
The examples on this page use the following ``Restaurant``, ``Address``, and ``GradeEntry``
29+
classes as models:
2930

30-
.. literalinclude:: ../../../includes/fundamentals/code-examples/crud/Restaurant.cs
31+
.. literalinclude:: includes/code-examples/Restaurant.cs
32+
:language: csharp
33+
:copyable:
34+
:dedent:
35+
36+
.. literalinclude:: includes/code-examples/Address.cs
37+
:language: csharp
38+
:copyable:
39+
:dedent:
40+
41+
.. literalinclude:: includes/code-examples/GradeEntry.cs
3142
:language: csharp
3243
:copyable:
3344
:dedent:

source/fundamentals/crud/write-operations/change.txt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,23 @@ Sample Data
2626

2727
The examples in this guide use the ``restaurants`` collection
2828
from the ``sample_restaurants`` database. The documents in this
29-
collection use the following ``Restaurant`` class as a model:
29+
collection use the following ``Restaurant``, ``Address``, and ``GradeEntry``
30+
classes as models:
3031

31-
.. literalinclude:: /includes/fundamentals/code-examples/crud/change/Restaurant.cs
32+
.. literalinclude:: includes/code-examples/Restaurant.cs
3233
:language: csharp
34+
:copyable:
35+
:dedent:
36+
37+
.. literalinclude:: includes/code-examples/Address.cs
38+
:language: csharp
39+
:copyable:
40+
:dedent:
41+
42+
.. literalinclude:: includes/code-examples/GradeEntry.cs
43+
:language: csharp
44+
:copyable:
3345
:dedent:
34-
:start-after: start-model
35-
:end-before: end-model
3646

3747
.. include:: /includes/convention-pack-note.rst
3848

source/fundamentals/crud/write-operations/delete.txt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,25 @@ collections using delete operations.
2121
Sample Data
2222
~~~~~~~~~~~
2323

24-
The example in this guide use the ``restaurants`` collection
24+
The examples in this guide use the ``restaurants`` collection
2525
from the ``sample_restaurants`` database. The documents in this
26-
collection are modeled by the following ``Restaurant`` class:
26+
collection use the following ``Restaurant``, ``Address``, and ``GradeEntry``
27+
classes as models:
2728

28-
.. literalinclude:: /includes/fundamentals/code-examples/crud/delete.cs
29+
.. literalinclude:: includes/code-examples/Restaurant.cs
2930
:language: csharp
31+
:copyable:
32+
:dedent:
33+
34+
.. literalinclude:: includes/code-examples/Address.cs
35+
:language: csharp
36+
:copyable:
37+
:dedent:
38+
39+
.. literalinclude:: includes/code-examples/GradeEntry.cs
40+
:language: csharp
41+
:copyable:
3042
:dedent:
31-
:start-after: start-model
32-
:end-before: end-model
3343

3444
.. include:: /includes/convention-pack-note.rst
3545

source/fundamentals/crud/write-operations/insert.txt

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,25 @@ collections using insert operations.
2121
Sample Data
2222
~~~~~~~~~~~
2323

24-
The example in this guide uses the ``restaurants`` collection
25-
from the ``sample_restaurants`` database. The inserted documents in the
26-
example are modeled by the following ``Restaurant`` class:
24+
The examples in this guide use the ``restaurants`` collection
25+
from the ``sample_restaurants`` database. The documents in this
26+
collection use the following ``Restaurant``, ``Address``, and ``GradeEntry``
27+
classes as models:
2728

28-
.. literalinclude:: /includes/fundamentals/code-examples/crud/insert.cs
29+
.. literalinclude:: includes/code-examples/Restaurant.cs
30+
:language: csharp
31+
:copyable:
32+
:dedent:
33+
34+
.. literalinclude:: includes/code-examples/Address.cs
35+
:language: csharp
36+
:copyable:
37+
:dedent:
38+
39+
.. literalinclude:: includes/code-examples/GradeEntry.cs
2940
:language: csharp
41+
:copyable:
3042
:dedent:
31-
:start-after: start-model
32-
:end-before: end-model
3343

3444
.. include:: /includes/convention-pack-note.rst
3545

source/includes/quick-start/Address.cs renamed to source/includes/code-examples/Address.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using MongoDB.Bson;
22
using MongoDB.Bson.Serialization.Attributes;
33

4+
namespace CSharpExamples.UsageExamples;
5+
46
public class Address
57
{
68
public string Building { get; set; }

source/includes/code-examples/DeleteOne.cs

Lines changed: 0 additions & 77 deletions
This file was deleted.

source/includes/code-examples/DeleteOneAsync.cs

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)