ArangoDB2

 view release on metacpan or  search on metacpan

lib/ArangoDB2/Transaction.pm  view on Meta::CPAN

# collections
#
# get/set collections
sub collections { shift->_get_set('collections', @_) }

sub execute
{
    my($self, $args) = @_;
    # process args
    $args = $self->_build_args($args, [qw(
        action collections lockTimeout params waitForSync
    )]);

    return $self->arango->http->post(
        $self->api_path('transaction'),
        undef,
        $JSON->encode($args),
    );
}

# lockTimeout
#
# get/set lockTimeout
sub lockTimeout { shift->_get_set('lockTimeout', @_) }

# params
#
# get/set params
sub params { shift->_get_set('params', @_) }

# waitForSync
#
# get/set waitForSync value
sub waitForSync { shift->_get_set_bool('waitForSync', @_) }

lib/ArangoDB2/Transaction.pm  view on Meta::CPAN

=over 4

=item new

=item action

=item collections

=item execute

=item lockTimeout

=item params

=item waitForSync

=back

=head1 AUTHOR

Ersun Warncke, C<< <ersun.warncke at outlook.com> >>

t/10-transaction.t  view on Meta::CPAN

my $dbname = "ngukvderybvfgjutecbxzsfhyujmnvgf";
my $database = $arango->database($dbname);
my $collection = $database->collection('foobar');
my $transaction = $database->transaction;

# test required methods
my @methods = qw(
    action
    collections
    execute
    lockTimeout
    params
    waitForSync
);

for my $method (@methods) {
    can_ok($transaction, $method);
}

# skip tests against the actual ArangoDB2 server unless
# LIVE_TEST env param is set



( run in 0.249 second using v1.01-cache-2.11-cpan-4d50c553e7e )