Skip to content

Version 22: Update with mask

Compare
Choose a tag to compare
@grahamearley grahamearley released this 21 Sep 00:48
97b3b3c

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!