Skip to content

Commit 61f7420

Browse files
authored
Update 2-match.mdx
fixed some inconsistencies in match
1 parent b736a97 commit 61f7420

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/30-simple-queries/2-match.mdx

+8-8
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ IF pages == 100 AND totalInventory == 1 {
133133
}
134134
```
135135

136-
👐 Return all the `books` from 2009 that have exactly 192 pages.
136+
👐 Return all the `books` from 2015 that have exactly 100 pages.
137137

138138
<details>
139139
<summary>Answer</summary>
@@ -146,8 +146,8 @@ IF pages == 100 AND totalInventory == 1 {
146146
{
147147
$match: {
148148
$and: [
149-
{ pages: 192 },
150-
{ year: 2009 }
149+
{ pages: 100 },
150+
{ year: 2015 }
151151
]
152152
}
153153
}
@@ -160,8 +160,8 @@ db.books.aggregate([
160160
{
161161
$match: {
162162
$and: [
163-
{ pages: 192 },
164-
{ year: 2009 }
163+
{ pages: 100 },
164+
{ year: 2015 }
165165
]
166166
}
167167
}
@@ -237,7 +237,7 @@ db.books.aggregate([
237237
</Tabs>
238238

239239

240-
👐 Return all the `books` from 2009 that have exactly 192 pages, using the shorthand `$and` notation:
240+
👐 Return all the `books` from 2015 that have exactly 100 pages, using the shorthand `$and` notation:
241241

242242
<details>
243243
<summary>Answer</summary>
@@ -248,14 +248,14 @@ db.books.aggregate([
248248
```js
249249
[
250250
{
251-
$match: {pages: 192, year: 2009}
251+
$match: {pages: 100, year: 2015}
252252
}
253253
]
254254
```
255255
</TabItem>
256256
<TabItem value="mongodb-shell" label="MongoDB Shell">
257257
```js
258-
db.books.aggregate([{$match: {pages: 192, year: 2009}}])
258+
db.books.aggregate([{$match: {pages: 100, year: 2015}}])
259259
```
260260
</TabItem>
261261
</Tabs>

0 commit comments

Comments
 (0)