You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/40-using-arrays/40-search-inside-objects-in-arrays.mdx
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
importTabsfrom'@theme/Tabs';
2
2
importTabItemfrom'@theme/TabItem';
3
3
4
-
# 👐 Searching inside Objects in arrays
4
+
# 👐 Searching Inside Objects in Arrays
5
5
6
6
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:
7
7
@@ -38,7 +38,7 @@ attributes: [
38
38
39
39
## Matching object fields, the simplest way
40
40
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`?
42
42
43
43
<TabsgroupId="aggregations">
44
44
<TabItemvalue="atlas"label="Atlas UI">
@@ -62,7 +62,7 @@ db.books.aggregate([
62
62
</TabItem>
63
63
</Tabs>
64
64
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:
66
66
67
67
<TabsgroupId="aggregations">
68
68
<TabItemvalue="atlas"label="Atlas UI">
@@ -87,7 +87,7 @@ db.books.aggregate([
87
87
</Tabs>
88
88
89
89
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`):
91
91
92
92
<details>
93
93
<summary>Answer</summary>
@@ -197,7 +197,7 @@ db.books.aggregate([
197
197
</Tabs>
198
198
199
199
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.
201
201
202
202
👐 To better understand `$unwind`, run this aggregation.
0 commit comments