Prism · Transform
$update
Changes the value at one path and returns everything else identical. The value now at the path is bound as current (null when it is absent) for the new value to be computed from.
{
document: {
component: 'Stepper',
props: { count: 3, label: 'Seats' },
},
}{
$update: {
from: { $ref: '$.document' },
path: ['props', 'count'],
value: { $add: [{ $var: 'current' }, { $const: 1 }] },
},
}{
component: 'Stepper',
props: { count: 4, label: 'Seats' },
}Runs in this page on the installed package. The input and the expected output are defined by the example.