1 package DX::Update::AddValue;
3 use DX::Utils qw(VALUE_EXISTS);
6 with 'DX::Role::Update';
8 has new_value => (is => 'ro', required => 1);
11 my ($self, $scope) = @_;
12 my @path = my @whole_path = @{$self->target_path};
13 my $target = pop @path;
14 my $new_value = $self->new_value;
16 $self->_with_value_at_path(
17 $scope, sub { $_[0]->with_member_at($target, $new_value) }, @path
19 [ VALUE_EXISTS ,=> @whole_path ],