NAME
ArangoDB::Statement
SYNOPSIS
use ArangoDB;
my $db = ArangoDB->new({
host => 'localhost',
port => 8529,
});
my $sth = $db->query('FOR u IN users FILTER u.active == true');
my $cur = $sth->execute();
while( my $doc = $cur->next() ){
# do something
}
# Use bind variable
$sth = $db->query('FOR u IN users FILTER u.age >= @age');
$sth->bind( age => 18 );
$cur = $sth->execute();
while( my $doc = $cur->next() ){
# do something
}
DESCRIPTION
A AQL(Arango Query Language) statement handler.
METHODS
new($conn,$query)
Constructor.
$conn is instance of ArangoDB::Connection. $query is AQL statement.
execute($options)
Execute AQL query and returns cursor(instance of ArangoDB::Cursor).
$options is query options.The attributes of $options are:
- batch_size
-
Maximum number of result documents to be transferred from the server to the client in one roundtrip (optional).
- do_count
-
Boolean flag that indicates whether the number of documents found should be returned as "count" attribute in the result set (optional).
parse()
Parse a query string without executing. Return ARRAY reference of bind variable names.
explain()
Get execution plan of query. Returns ARRAY reference.
bind_vars($name)
Returns bind variable based on $name. If $name does not passed, returns all bind variables as HASH reference.
bind($vars) =head2 bind($key => $val)
Set bind variable(s). $vars is HASH reference that set of key/value pairs.
validate_query()
Validate a query string without executing