Skip to content

Commit f46aeaa

Browse files
authored
Merge pull request #26 from Meg528/patch-18
Update 10-sorting.mdx
2 parents 3707d67 + 59ff357 commit f46aeaa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/50-counting-sorting/10-sorting.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
We can sort our results using the `$sort` stage. We need to sort on a field, being 1 ascending and -1 descending order.
44

5-
👐 Let's get all books from 1984, sorted by number of pages. We'll only show the title, pages and authors.
5+
👐 Let's get all books from 1984, sorted by number of pages. We'll only show the title, pages, and authors.
66

77
```js
88
let booksFrom1984 = {$match: {year: 1984}};
@@ -16,7 +16,7 @@ db.books.aggregate([
1616
]);
1717
```
1818

19-
As we can see, books with no `pages` info appear first. These documents don't have that information, hence `pages` is `null` and gets sorted as less than any number.
19+
As we can see, books with no `pages` info appear first. These documents don't have that information. Hence, `pages` is `null` and gets sorted as less than any number.
2020

2121
👐 We can sort the other way around:
2222

@@ -52,4 +52,4 @@ db.books.aggregate([
5252
]);
5353
```
5454
</div>
55-
</details>
55+
</details>

0 commit comments

Comments
 (0)