Skip to content

Commit 7352400

Browse files
authored
Update 2-search-inside-objects-in-arrays.mdx
1 parent ac67fd2 commit 7352400

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 👐 Searching inside Objects in arrays
22

3-
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:
3+
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:
44

55
```js
66
attributes: [
@@ -31,7 +31,7 @@ attributes: [
3131
],
3232
```
3333

34-
How do we search for all the books that have an msrp of 9.99? We want books that, inside `attributes` has an object with key `msrp` and value `9.99`. We can get it to work with this:
34+
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`. We can get it to work with this:
3535

3636
```js
3737
db.books.aggregate([
@@ -43,7 +43,7 @@ db.books.aggregate([
4343

4444
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 which will be different for each of these generated docs.
4545

46-
👐 To better understand `$unwind`, run this aggregation
46+
👐 To better understand `$unwind`, run this aggregation.
4747

4848
```js
4949
db.books.aggregate([

0 commit comments

Comments
 (0)