Skip to content

Commit 9938c44

Browse files
committed
1 parent 3824c65 commit 9938c44

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

source/reference/projection/elemMatch.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ $elemMatch (projection)
3535

3636
.. code-block:: javascript
3737

38-
db.students.find( { zipcode: 63109 },
39-
{ _id: 0,
40-
dependents: { $elemMatch: { school: 102 } } } )
38+
var projection = { _id: 0, dependents: { $elemMatch: { school: 102 }}};
39+
db.students.find( { zipcode: 63109 }, projection);
4140

4241
The query would return all documents where the value of the
4342
``zipcode`` field is ``63109``, while the projection excludes

0 commit comments

Comments
 (0)