Skip to content

Commit a152cc7

Browse files
committed
Fix/Cosmetic edits to matching stages in sort-limit
1 parent 43cd36a commit a152cc7

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

docs/50-aggregation/3-sort-limit.mdx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,12 @@ Learn [when to use $addFields over $project](https://www.practical-mongodb-aggre
195195
```python
196196
most_authors = books.aggregate
197197
([
198-
{ "$match": { "year": { "$gt": 2000 } } },
199-
{ "$match": { "authors": { "$exists": True } } },
198+
{
199+
"$match": {
200+
"year": { "$gt": 2000 },
201+
"authors": { "$exists": True }
202+
}
203+
},
200204
{
201205
"$project": {
202206
"title": 1,
@@ -220,8 +224,11 @@ Learn [when to use $addFields over $project](https://www.practical-mongodb-aggre
220224
```python
221225
most_authors = books.aggregate
222226
([
223-
{ "$match": { "year": { "$gt": 2000 } } },
224-
{ "$match": { "authors": { "$exists": True } } },
227+
{
228+
"$match":
229+
{ "year": { "$gt": 2000 } },
230+
{ "authors": { "$exists": True } }
231+
},
225232
{
226233
"$addFields": {
227234
"numAuthors": { "$size": "$authors" }

0 commit comments

Comments
 (0)