Version 22: Update with mask
Now the update function includes an extra boolean parameter, mask
. When true, the update will apply as a mask. So if your document looks like this:
{ number: 1, text: "Hello" }
and you call update with mask = true
with this object as your mask:
{ number: 2 }
then the number
field will be updated, but the text field will not. The resulting document will be
{ number: 2, text: "Hello" }
Thanks to @webstermath for this feature!