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
Console.WriteLine(book.ToJson()); // Shows the entire BSON document as JSON to show that some fields are null because they are not returned due to the projection
Copy file name to clipboardExpand all lines: docs/50-aggregation/3-sort-limit.mdx
+99-49Lines changed: 99 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,64 +77,114 @@ SELECT * FROM books ORDER BY timestamp DESC LIMIT 5;
77
77
<details>
78
78
<summary>Answer</summary>
79
79
<div>
80
-
There are 2 ways to solve this-
80
+
There are 2 ways to solve this-
81
81
- $project
82
82
- $addFields
83
83
84
84
:::info
85
85
Learn [when to use $addFields over $project](https://www.practical-mongodb-aggregations.com/guides/project.html?highlight=%24project#when-to-use-project)
0 commit comments