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
Copy file name to clipboardExpand all lines: docs/80-modifying-results/adding-fields.mdx
+9-12Lines changed: 9 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,9 @@ import TabItem from '@theme/TabItem';
7
7
8
8
# 👐 Adding New Fields to Results
9
9
10
-
## $addFields
10
+
## $set / $addFields
11
11
12
-
We want to estimate the reading time for a book. But we don't have that field stored in our data. We can use `$addFields` for this. If the field exists, it'll get updated, and if it doesn't, it's added.
12
+
We want to estimate the reading time for a book. But we don't have that field stored in our data. We can use `$set` for this. If the field exists, it'll get updated, and if it doesn't, it's added.
13
13
14
14
15
15
<TabsgroupId="aggregations">
@@ -22,7 +22,7 @@ We want to estimate the reading time for a book. But we don't have that field st
[$set](https://www.mongodb.com/docs/manual/reference/operator/aggregation/set/#mongodb-pipeline-pipe.-set) is an alias for $addFields that you'll find on many older posts and documentation.
94
-
:::
95
-
96
-
</details>
92
+
[$set](https://www.mongodb.com/docs/manual/reference/operator/aggregation/set/#mongodb-pipeline-pipe.-set) is a new alias for `$addFields`. You'll still find `$addFields` on many older posts and documentation.
0 commit comments