ArangoDB
view release on metacpan or search on metacpan
NAME
ArangoDB - ArangoDB client for Perl
SYNOPSIS
use ArangoDB;
my $db = ArangoDB->new(
host => 'localhost',
port => 8529,
keep_alive => 1,
);
# Find or create collection
my $foo = $db->('foo');
# Create new document
$foo->save({ x => 42, y => { a => 1, b => 2, } });
$foo->save({ x => 1, y => { a => 1, b => 10, } });
$foo->name('new_name'); # rename the collection
# Create hash index.
$foo->ensure_hash_index([qw/x y/]);
# Simple query
my $cursor = $db->('new_name')->by_example({ b => 2 });
while( my $doc = $cursor->next ){
# do something
}
# AQL
my $cursor2 = $db->query(
'FOR u IN users FILTER u.age > @age SORT u.name ASC RETURN u'
)->bind( { age => 19 } )->execute();
my $docs = $cursor2->all;
DESCRIPTION
This module is an ArangoDB's REST API client for Perl.
ArangoDB is a universal open-source database with a flexible data model
for documents, graphs, and key-values.
More information: <http://www.arangodb.org/>
SUPPORT API VERSION
This supports ArangoDB API implementation 1.01.
METHODS
new($options)
Constructor.
$options is HASH reference.The attributes of $options are:
host
Hostname or IP address of ArangoDB server.
Default: localhost
port
Port number of ArangoDB server.
Default: 8529
timeout
Seconds of HTTP connection timeout.
Default: 300
keep_alive
If it is true, use HTTP Keep-Alive connection.
Default: false
auth_type
Authentication method. Supporting "Basic" only.
auth_user
User name for authentication
auth_passwd
Password for authentication
proxy
Proxy url for HTTP connection.
inet_aton
A callback function to customize name resolution. Takes two
arguments: ($hostname, $timeout_in_seconds).
See Furl::HTTP.
collection($name)
Get or create a collection based on $name. Returns instance of
ArangoDB::Collection.
( run in 0.889 second using v1.01-cache-2.11-cpan-39bf76dae61 )