Skip to content

Commit e3582b6

Browse files
authored
Merge pull request #58 from Meg528/patch-43
Update 40-search-inside-objects-in-arrays.mdx
2 parents b6285dd + 794d5ae commit e3582b6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/40-using-arrays/40-search-inside-objects-in-arrays.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Tabs from '@theme/Tabs';
22
import TabItem from '@theme/TabItem';
33

4-
# 👐 Searching inside Objects in arrays
4+
# 👐 Searching Inside Objects in Arrays
55

66
In our books, we're using the [Attribute Pattern](https://www.mongodb.com/developer/products/mongodb/attribute-pattern/) to have different attributes in our documents. As we can see in the [sample doc](/docs/simple-queries/project), we have an `attributes` array, containing several objects, each with the same structure:
77

@@ -38,7 +38,7 @@ attributes: [
3838

3939
## Matching object fields, the simplest way
4040

41-
How do we search for all the books that have an msrp of 9.99? We want books that, inside `attributes`, have an object with key `msrp` and value `9.99`?
41+
How do we search for all the books that have an MSRP of 9.99? We want books that, inside `attributes`, have an object with key `msrp` and value `9.99`?
4242

4343
<Tabs groupId="aggregations">
4444
<TabItem value="atlas" label="Atlas UI">
@@ -62,7 +62,7 @@ db.books.aggregate([
6262
</TabItem>
6363
</Tabs>
6464

65-
Above example is using the shorthand $and operator, that we can also explicitly write:
65+
The above example is using the shorthand $and operator, that we can also explicitly write:
6666

6767
<Tabs groupId="aggregations">
6868
<TabItem value="atlas" label="Atlas UI">
@@ -87,7 +87,7 @@ db.books.aggregate([
8787
</Tabs>
8888

8989

90-
Find all the books with an MSPR of 9.99 and that have been reprinted (hint: `edition` is `Reprint`)
90+
Find all the books with an MSPR of 9.99 and that have been reprinted (hint: `edition` is `Reprint`):
9191

9292
<details>
9393
<summary>Answer</summary>
@@ -197,7 +197,7 @@ db.books.aggregate([
197197
</Tabs>
198198

199199

200-
Here we're getting a copy of each book for each object inside the `$attributes` array. This "flattens" the array and returns many copies of the same documents, one for each different attribute that we have.
200+
Here, we're getting a copy of each book for each object inside the `$attributes` array. This "flattens" the array and returns many copies of the same documents, one for each different attribute that we have.
201201

202202
👐 To better understand `$unwind`, run this aggregation.
203203

0 commit comments

Comments
 (0)