set
Set a value at a given path.
This method chains a set operation to the patch.
The operation creates a new value at the specified path, overwriting any existing value.
Atomicity
If the parent path does not exist, or is not a collection, the operation fails and the entire patch is discarded.
Signature
This method has the following signature:
patch.set(path: string, value: JsonValue): Patch
The return is the Patch instance itself to allow operation chaining.
Example
Here is a basic example of how to use this method:
path.set('address.city', 'New York');
Parameters
The following list describes the supported parameters: