File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
source/reference/operator/update Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ Definition
9
9
10
10
.. update:: $set
11
11
12
- The :update:`$set` operator replaces the value of a field to the
12
+ The :update:`$set` operator replaces the value of a field with the
13
13
specified value.
14
14
15
15
The :update:`$set` operator expression has the following form:
@@ -23,11 +23,16 @@ Definition
23
23
Behavior
24
24
--------
25
25
26
- If the field does not exist, :update:`$set` will add the field with the
27
- specified value. If you specify a dotted path for a non-existent field,
26
+ If the field does not exist, :update:`$set` will add a new field with the
27
+ specified value, provided that the new field does not violate a type
28
+ constraint.
29
+ If you specify a dotted path for a non-existent field,
28
30
:update:`$set` will also create the embedded documents *as needed* to
29
31
fulfill the dotted path to the field.
30
32
33
+ If you specify multiple field-value pairs, :update:`$set` will update
34
+ or create each field.
35
+
31
36
Examples
32
37
--------
33
38
You can’t perform that action at this time.
0 commit comments