core.patchoptions | Medplum

PatchOptions interface

Signature:

export interface PatchOptions

Properties

Property Modifiers Type Description
implicitArrayCreation? boolean (Optional) When true, "add" operations with path ending in "/-" will implicitly create an empty array where possible.
For example, with this option enabled, for the object {live: true}, the operation add "/tag/-" 123 will result in {live: true, tag: [123]}. Subsequent operations behave normally: another add "/tag/-" 456 will result in {live: true, tag: [123, 456]}.
If the indicated array property already exists but is not an array, this will produce an error.
Only the leaf array will be inferred; missing parent objects will still produce errors.