Skip to content

Update 20-simple-match-array.mdx #54

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions docs/40-using-arrays/20-simple-match-array.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import TabItem from '@theme/TabItem';

# 👐 Simple arrays

## 👐 Get all the Science Fiction Books
## 👐 Get all the science fiction books

Can I get all books for the genre `Science Fiction`?. Turns out it's quite simple:
Can I get all books for the genre `Science Fiction`? Turns out it's quite simple:

<Tabs groupId="aggregations">
<TabItem value="atlas" label="Atlas UI">
Expand Down Expand Up @@ -40,7 +40,7 @@ Remember that will include any book that has any other genre as long as it has `

## 👐 Find all the books that belong at least to both genres "Fiction" and "Science Fiction"

If you want to search for all books that have "Fiction" and "Science Fiction", in any order (and possibly other genres) use:
If you want to search for all books that have "Fiction" and "Science Fiction," in any order (and possibly other genres), use:

<Tabs groupId="aggregations">
<TabItem value="atlas" label="Atlas UI">
Expand Down Expand Up @@ -108,7 +108,7 @@ db.books.aggregate([{

## 👐 Find all the books that belong only to the genres "Fiction" and "Science Fiction"

In this case, we want books that have both "Fiction" and "Science Fiction" in the genres array _and nothing else_. So we're looking for documents that contain a `genres` array exactly as `['Fiction', 'Science Fiction']`. We're not looking for the individual genres that could be inside the array, instead we are comparing the whole array on each document.
In this case, we want books that have both "Fiction" and "Science Fiction" in the genres array _and nothing else_. So we're looking for documents that contain a `genres` array exactly as `['Fiction', 'Science Fiction']`. We're not looking for the individual genres that could be inside the array. Instead, we are comparing the whole array on each document.

<Tabs groupId="aggregations">
<TabItem value="atlas" label="Atlas UI">
Expand Down Expand Up @@ -145,7 +145,7 @@ db.books.aggregate([
</TabItem>
</Tabs>

Here we're comparing the whole array. __Element order is important__. With this comparison you'll get nothing in return:
Here, we're comparing the whole array. __Element order is important__. With this comparison, you'll get nothing in return:

<Tabs groupId="aggregations">
<TabItem value="atlas" label="Atlas UI">
Expand Down Expand Up @@ -179,4 +179,4 @@ db.books.aggregate([
])
```
</TabItem>
</Tabs>
</Tabs>