Skip to content

DOCS-10250 Edited several places to make it clear that #3068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/includes/fact-positional-projection-vs-elemmatch.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Both the :projection:`$` operator and the :projection:`$elemMatch` operator project
a subset of elements from an array based on a condition.
the **first** matching element from an array based on a condition.

The :projection:`$` operator projects the array elements based on some condition
from the query statement.
The :projection:`$` operator projects the first matching array element from each
document in a collection based on some condition from the query statement.

The :projection:`$elemMatch` projection operator takes an explicit condition
argument. This allows you to project based on a condition not in the query, or
Expand Down
4 changes: 2 additions & 2 deletions source/reference/operator/projection/positional.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ Under these requirements, the following query is **incorrect**:
{ "<array>.$": 1 } )

To specify criteria on multiple fields of documents inside that array, use the
:query:`$elemMatch` query operator. The following query will return any
embedded documents inside a ``grades`` array that have a ``mean`` of greater than 70
:query:`$elemMatch` query operator. The following query returns the first
document inside a ``grades`` array that has a ``mean`` of greater than 70
and a ``grade`` of greater than 90.

.. code-block:: javascript
Expand Down