@@ -45,15 +45,14 @@ To learn how to create a free MongoDB Atlas cluster and load the sample datasets
45
45
Projection Types
46
46
----------------
47
47
48
- You can use a projection to specify which fields to include in a return
49
- document, or to specify which fields to exclude. You cannot combine inclusion and
50
- exclusion statements in a single projection, unless you are excluding the
51
- ``_id`` field.
48
+ You can use a projection to specify which fields to include or exclude in
49
+ a return Document. You cannot combine inclusion and exclusion statements in
50
+ a single projection, unless you are excluding the ``_id`` field.
52
51
53
52
Specify Fields to Include
54
53
~~~~~~~~~~~~~~~~~~~~~~~~~
55
54
56
- To specify the fields to include in the result, specify the ``projection``
55
+ To include specific fields in a read operation result, specify the ``projection``
57
56
option in a parameter to the ``find`` method. To set this option, use the following syntax:
58
57
59
58
.. code-block:: ruby
@@ -114,7 +113,7 @@ excludes the ``_id`` field from the projection:
114
113
Specify Fields to Exclude
115
114
~~~~~~~~~~~~~~~~~~~~~~~~~
116
115
117
- To specify the fields to exclude from the result, specify the ``projection``
116
+ To exclude specific fields from a read operation result, specify the ``projection``
118
117
option in a parameter to the ``find`` method. To set this option, use the
119
118
following syntax:
120
119
@@ -124,7 +123,7 @@ following syntax:
124
123
125
124
The following example uses the ``find`` method to find all restaurants in which the ``name``
126
125
field value is ``'Emerald Pub'``. Then, the code uses the ``projection`` option
127
- to instruct the find operation to omit the ``name `` and ``address`` fields
126
+ to instruct the find operation to omit the ``grades `` and ``address`` fields
128
127
in the result:
129
128
130
129
.. io-code-block::
0 commit comments