ArangoDB::Statement - An ArangoDB AQL handler
use ArangoDB; my $db = ArangoDB->new( host => 'localhost', port => 8529, ); my $sth = $db->query('FOR u IN users FILTER u.active == true RETURN u'); my $cursor = $sth->execute({ do_count => 1, batch_size => 10, }); while( my $doc = $cursor->next() ){ # do something } # Use bind variable my $documents = $db->query( 'FOR u IN users FILTER u.age >= @age SORT u.name ASC RETURN u' )->bind( age => 18 )->execute()->all;
An AQL(ArangoDB Query Language) statement handler.
Constructor.
Instance of ArangoDB::Connection.
AQL statement.
Execute AQL query and returns cursor(instance of ArangoDB::Cursor).
$options is query options.The attributes of $options are:
Maximum number of result documents to be transferred from the server to the client in one roundtrip (optional).
Boolean flag that indicates whether the number of documents found should be returned as "count" attribute in the result set (optional).
Parse a query string without executing.
Return ARRAY reference of bind variable names.
Get execution plan of query.
Returns ARRAY reference.
Returns bind variable based on $name.
If $name does not passed, returns all bind variables as HASH reference.
Set bind variable(s).
HASH reference that set of key/value pairs.
Bind variable name.
Bind variable value.
Returns instance of ArangoDB::Statement.You can use method chain:
my $documents = $db->query( 'FOR u IN users FILTER u.type == @type && u.age >= @age SORT u.name ASC RETURN u' )->bind({ type => 1, age => 19 })->execute->all;
Hideaki Ohno <hide.o.j55 {at} gmail.com>
To install ArangoDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ArangoDB
CPAN shell
perl -MCPAN -e shell install ArangoDB
For more information on module installation, please visit the detailed CPAN module installation guide.