Skip to content

Commit 071b700

Browse files
committed
improvements to set reference
1 parent 7e0c880 commit 071b700

File tree

1 file changed

+8
-3
lines changed
  • source/reference/operator/update

1 file changed

+8
-3
lines changed

source/reference/operator/update/set.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Definition
99

1010
.. update:: $set
1111

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
1313
specified value.
1414

1515
The :update:`$set` operator expression has the following form:
@@ -23,11 +23,16 @@ Definition
2323
Behavior
2424
--------
2525

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,
2830
:update:`$set` will also create the embedded documents *as needed* to
2931
fulfill the dotted path to the field.
3032

33+
If you specify multiple field-value pairs, :update:`$set` will update
34+
or create each field.
35+
3136
Examples
3237
--------
3338

0 commit comments

Comments
 (0)