diff --git a/source/reference/operator/update/set.txt b/source/reference/operator/update/set.txt index 21b5f4864e3..6ff5a78038d 100644 --- a/source/reference/operator/update/set.txt +++ b/source/reference/operator/update/set.txt @@ -9,7 +9,7 @@ Definition .. update:: $set - The :update:`$set` operator replaces the value of a field to the + The :update:`$set` operator replaces the value of a field with the specified value. The :update:`$set` operator expression has the following form: @@ -23,11 +23,16 @@ Definition Behavior -------- -If the field does not exist, :update:`$set` will add the field with the -specified value. If you specify a dotted path for a non-existent field, -:update:`$set` will also create the embedded documents *as needed* to +If the field does not exist, :update:`$set` will add a new field with the +specified value, provided that the new field does not violate a type +constraint. +If you specify a dotted path for a non-existent field, +:update:`$set` will create the embedded documents *as needed* to fulfill the dotted path to the field. +If you specify multiple field-value pairs, :update:`$set` will update +or create each field. + Examples --------