@@ -27,10 +27,9 @@ which fields MongoDB returns from a query.
27
27
Sample Data
28
28
~~~~~~~~~~~
29
29
30
- The examples in this guide use the ``restaurants`` collection in the ``sample_restaurants``
31
- database from the :atlas:`Atlas sample datasets </sample-data>`. To learn how to create a
32
- free MongoDB Atlas cluster and load the sample datasets, see the
33
- :atlas:`Get Started with Atlas </getting-started>` guide.
30
+ The examples in this guide use the ``sample_restaurants.restaurants`` collection
31
+ from the :atlas:`Atlas sample datasets </sample-data>`. To learn how to create a
32
+ free MongoDB Atlas cluster and load the sample datasets, see the :ref:`<csharp-quickstart>`.
34
33
35
34
The examples on this page use the following ``Restaurant`` and ``Address`` classes to model
36
35
the documents in the collection:
@@ -57,15 +56,15 @@ To remove the ``_id`` field from the returned document, you must
57
56
Specify Fields to Include
58
57
~~~~~~~~~~~~~~~~~~~~~~~~~
59
58
60
- To specify the fields to include from the result, chain the ``Projection ()`` method
61
- to the ``Find()`` method. When calling the ``Projection ()`` method, you must pass in the
59
+ To specify the fields to include from the result, chain the ``Project ()`` method
60
+ to the ``Find()`` method. When calling the ``Project ()`` method, you must pass in the
62
61
projection definition as a parameter. You can construct a projection definition by using
63
62
the ``Builders<T>.Projection.Include()`` method and passing in the field name to include
64
63
as a parameter. This method can be chained to include multiple fields in the projection.
65
64
66
65
The following example uses the ``Find()`` method to find all restaurants in which the ``name``
67
- field value is ``"Emerald Pub"``. Then, the code calls the ``projection()`` and ``exclude ()``
68
- methods to instruct the find operation to omit the ``name`` and ``address`` fields
66
+ field value is ``"Emerald Pub"``. Then, the code calls the ``Project ()``
67
+ method to instruct the find operation to include the ``name`` and ``address`` fields
69
68
in the result:
70
69
71
70
.. io-code-block::
@@ -112,7 +111,7 @@ excludes the ``_id`` field from the projection:
112
111
Specify Fields to Exclude
113
112
~~~~~~~~~~~~~~~~~~~~~~~~~
114
113
115
- To specify the fields to include from the result, chain the ``Projection ()`` method
114
+ To specify the fields to include from the result, chain the ``Project ()`` method
116
115
to the ``Find()`` method. You can exclude fields in your projection by using
117
116
the ``Builders<T>.Projection.Exclude()`` method and passing in the field name to exclude
118
117
as a parameter. This method can be chained to exclude multiple fields in the projection.
0 commit comments